https://www.acmicpc.net/problem/5532
using System;
class Program
{
static void Main() {
string s=Console.ReadLine();
int l=int.Parse(s);
string s1=Console.ReadLine();
int a=int.Parse(s1);
string s2=Console.ReadLine();
int b=int.Parse(s2);
string s3=Console.ReadLine();
int c=int.Parse(s3);
string s4=Console.ReadLine();
int d=int.Parse(s4);
int sum=0;
int sum1=0;
if(a%c==0) sum=a/c;
else sum=a/c+1;
if(b%d==0) sum1=b/d;
else sum1=b/d+1;
Console.Write(Math.Min(l-sum,l-sum1));
}
}