Go: package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextFloat64() (float64, error) {
	return strconv.ParseFloat(nextString(), 64)
}

func main() {
	scanner.Split(bufio.ScanWords)

	n := 5
	array := make([]float64, n)
	for i := 0; i < n; i++ {
		array[i], _ = nextFloat64()
	}

	// fmt.Println(array)
	fmt.Println(int(array[0] - math.Ceil(math.Max(array[1]/array[3], array[2]/array[4]))))
}

C++: #include<stdio.h>
int main(void){
    int L,A,B,C,D;
    int i;
    scanf("%d",&L);
    scanf("%d",&A);
    scanf("%d",&B);
    scanf("%d",&C);
    scanf("%d",&D);
    int n=A/C;
    if(A%C!=0)n=n+1;
    int m=B/D;
    if(B%D!=0)m=m+1;
    if(n<m)n=m;
    int c=L-n;
    printf("%d\n",c);
return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;

int main()
{
int a,b,c,d,e;
 cin>>a>>b>>c>>d>>e;
cout<<a-max(b/d+(b%d==0?0:1),c/e+(c%e==0?0:1))<<endl;
}

C++: #include<stdio.h>
int main(void)
{
	int n,a,b,c,d;
	int s,ss;
	scanf("%d",&n);
	scanf("%d",&a);
	scanf("%d",&b);
	scanf("%d",&c);
	scanf("%d",&d);

	s=a/c;
	//printf("s=%d\n",s);
	if(a%c!=0){
	s=s+1;
	//printf("s1=%d\n",s);
	}
	ss=b/d;
	//printf("ss=%d\n",ss);
	if(b%s!=0){
		ss=ss+1;
	//	printf("ss=%d\n",ss);
	}
	
	if(s>ss){
		n=n-s;
		printf("%d\n",n);
	}
	else if(ss>s){
		n=n-ss;
		printf("%d\n",n);
	}
	else{
		n=n-s;
		printf("%d\n",n);
	}
	return 0;
}

C++: #include "stdio.h"
int main(){
    int L, A, B, C,D,E,F,G,max = 0;
    scanf("%d",&L);
    scanf("%d",&A);
    scanf("%d",&B);
    scanf("%d",&C);
    scanf("%d",&D);
    
    if(A % C != 0){
        F = A/C + 1;

    }else{ F = A/C;

    }
    if(B % D != 0){
        G = B/D + 1;

    }else{ G = B/D;

    }
    
    if(F >= G){
    max = L - F;
    }else if(F < G){
    max = L - G;
    }
    printf("%d\n",max);
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <string>
#include <map>
#include <functional>
#include <cmath>
#include <cstdio>
using namespace std;

#define PI 4*atan(1);

int main(){
  int l, a, b, c, d;
  int cnt = 0;
  cin >> l >> a >> b >> c >> d;
  for(;;){
    a -= c;
    b -= d;
    cnt++;
    if(a <= 0 && b <= 0)break;
  }
  cout << l - cnt << endl;
}

C++: #include<iostream>
using namespace std;
 
int main()
{
int L,A,B,C,D,K,E,F,G,H;
cin>>L>>A>>B>>C>>D;
E=A/C;
F=B/D;
G=A%C;
H=B%D;
if(E<F){
if(G>0){
E+=1;
}
if(H>0){
F+=1;
}
K=L-E;
}
if(E>F){
if(G>0){
E+=1;
}
if(H>0){
F+=1;
}
K=L-F;
}
else{
if(G>0){
E+=1;
}
if(H>0){
F+=1;
}
K=L-E;
}
cout<<K<<'\n';
return 0;
}

C++: #include<iostream>
#include<cmath>
using namespace std;

int main(){
	int n;
	while(cin>>n){
		double a,b,c,d;
		cin>>a>>b>>c>>d;
		cout<<n-max(ceil(a/c),ceil(b/d))<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;

int main(){

  int L,A,B,C,D,day[2];

  cin >> L >> A >> B >> C >> D;
  day[0] = A/C;
  if(day[0]*C != A){
    day[0]++;
  }
  day[1] = B/D;
  if(day[1]*D != B){
    day[1]++;
  }
  sort(day,day+2);
  printf("%d\n",day[1]);
  
  cout << L-day[1] << endl;
}

C++: #include <cstdio>
#include <algorithm>
using namespace std;

int main(){
	int L, A, B, C, D;
	int jap, mat;
	
	scanf("%d%d%d%d%d", &L, &A, &B, &C, &D);
	
	jap = (A + C - 1) / C;
	mat = (B + D - 1) / D;
	
	printf("%d\n", L - max(jap, mat));
	
	return 0;
}

C++: #include<iostream>
using namespace std;

int main(){
  int L,A,B,C,D;
 
  cin>>L>>A>>B>>C>>D;
  
  int day=1;
  while(1){
    if(A<=C*day&&B<=D*day)break;
    day++;
  }

  cout<<L-day<<endl;
 return 0;
}

C++: #include <iostream>
using namespace std;

int main() {
	int l, a, b, c, d, s, t;
	cin >> l >> a >> b >> c >> d;
	
	if (a % c)
		s = a / c + 1;
	else
		s = a / c;
	if (b % d)
		t = b / d + 1;
	else
		t = b / d;
	
	if (s > t)
		cout << l - s << endl;
	else
		cout << l - t << endl;
	
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int L,A,B,C,D;
	int count;
	int count1;

	count=0;
	count1=0;
	
	scanf("%d %d %d %d %d",&L,&A,&B,&C,&D);
		while(0<A){
			A-=C;
			count++;
		}
		while(0<B){	
			B-=D;
			count1++;
		}
				if(count>count1){
					printf("%d\n",L-count);
				}
				else if(count=count1){
					printf("%d\n",L-count);
				}
				else{
					printf("%d\n",L-count1);
				}
	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

int main(){

	int n,a,b,c,d;
	cin>> n >> a >> b >> c >> d;
	int na = a / c;
	if(a % c != 0)na++;
	int nb = b / d;
	if(b % d != 0)nb++;
	cout << n-max(na,nb) << endl;
	return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int l,a,b,c,d;
	cin >> l >> a >> b >> c >> d;
	int _a = a%c==0?a/c:a/c+1;
	int _b = b%d==0?b/d:b/d+1;
	cout << l-(max(_a,_b)) << endl;
	return 0;
}

C++: #include<iostream>
using namespace std;
       
int main()
{
int L,A,B,C,D,K,E,F;
cin>>L>>A>>B>>C>>D;
E=A/C;
F=B/D;
if(A%C>0){
E+=1;
}
if(B%D>0){
F+=1;
}
if(E>F){
K=L-E;
}
else
K=L-F;
cout<<K<<'\n';
return 0;
}

C++: #include <iostream>
using namespace std;

int main()
{
  int a, b, c, d, l;
  
  cin >> l >> a >> b >> c >> d;
  if (a % c == 0){
    a = a / c;
  }
  else {
    a = a / c + 1;
  }
  if (b % d == 0){
    b = b / d;
  }
  else {
    b = b / d + 1;
  }
  cout << l - max(a, b) << endl;
  return (0);
}

C++: #include<iostream>
#include<string>
using namespace std;

int main(){
	/*
	int a,b,c,d,e;

	cin >> a >> b >> c >> d >> e;

	int x;

	if(a > 0){
		x = e*(b-a);
	}
	if(a == 0){
		x = e*b + d;
	}
	if(a < 0){
		x = -c*a + e*b + d;
	}

	cout << x <<endl;
	*/

	/*
	int a,b,c,d,e,f;
	cin >> a >> b >> c >> d >> e >> f;
	int m,n;
	int x = a + b + c + d + e + f;


	
	if(e<f)
	{
		x = x - e;
		if(a<b)
		{
			if(a<c)
			{
				if(a<d)
				{
					cout << x-a << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
			else
			{
					if(c<d)
				{
					cout << x-c << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
		}
		else
		{
			if(b<c)
			{
				if(b<d)
				{
					cout << x-b << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
			else
			{
					if(c<d)
				{
					cout << x-c << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
		}
	}
	else
	{
		x = x - f;
		if(a<b)
		{
			if(a<c)
			{
				if(a<d)
				{
					cout << x-a << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
			else
			{
					if(c<d)
				{
					cout << x-c << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
		}
		else
		{
			if(b<c)
			{
				if(b<d)
				{
					cout << x-b << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
			else
			{
					if(c<d)
				{
					cout << x-c << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
		}
	}
	*/
/*
	int n;
	cin >> n;
	int a;
	cin >> a;
	int max = a,min = a;
	int i = 1;
	while(i<n){
		cin >> a;
		if(a > max){
			max = a;
		}
		if(a < min){
			min = a;
		}
		i++;
	}
	cout << max << endl << min << endl;
	*/
	/*
	string s;
	cin >> s;
	int j,o,i;
	for(int i;i < s.size;i++){
		
	}
	*/
	/*
	int n;
	cin >> n;
	int A;
	int X[100000];
	int n=0;
	for(int i=0;i<n;i++){
		cin >> A;
		
	}
	*/
	/*
	int a,b,c,d,p;
	cin >> a >> b >> c >> d >> p;
	int X,Y=b;

	X = a*p;
	
	if(p>c){
		Y += d*(p-c);
	}

	if(X > Y){
		cout << Y << endl;
	}
	else{
		cout << X << endl;
	}
	*/

	int l,a,b,c,d;
	cin >> l >> a >> b >> c >> d;
	int day;

	if(a/c > b/d){
		day = a/c;
	}else{
		day = b/d;
	}

	cout << l - day << endl;

	return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include<cstdio>
#include<algorithm>

int main(){
	int l, a, b, c, d;
	scanf("%d%d%d%d%d", &l, &a, &b, &c, &d);
	printf("%d\n", l-std::max(a%c == 0 ? a / c : a / c + 1, b%d == 0 ? b / d : b / d + 1));
	return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int L,A,B,C,D;
  cin >> L >> A >> B >> C >> D;
  cout << L - max((double)A/(double)C==A/C?A/C:A/C+1,(double)B/(double)D==B/D?B/D:B/D+1) << endl;
}