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 <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define INF INT_MAX/3
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define CLR(a) memset(a,0,sizeof(a))

typedef long long int ll;

using namespace std;

int main(){
    int l,a,b,c,d;
    cin >> l >> a >> b >> c >> d;
    int ans = 0;
    while(true){
	ans++;
	if(c*ans >= a && d*ans >= b){
	    break;
	}
    }
    ans = l - ans;
    cout << ans << endl;
    return 0;
}

C++: #include <stdio.h>
int main(){
  int fuyu,a,b,amax,bmax;
  int aday,bday,day;
  scanf("%d",&fuyu);
  scanf("%d",&a);
  scanf("%d",&b);
  scanf("%d",&amax);
  scanf("%d",&bmax);
  aday=a/amax;
  if(a%amax!=0){
    aday+=1;
  }
  bday=b/bmax;
  if(b%bmax!=0){
    bday+=1;
  }
  day=aday;
  if(bday>day){
    day=bday;
  }
  
  printf("%d\n",fuyu-day);
  return 0;
}

C++: #include<iostream>
#include<cmath>

int main()
{
	int L;
	int A, B;
	int C, D;

	std::cin >> L >> A >> B >> C >> D;

	std::cout << (int)(L - std::max( ceil( (double)A / C ), ceil( (double)B / D ) )) << std::endl;

	return 0;
}

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

using namespace std;

int L, A, B, C, D;

int main() {
	int sum;

	cin >> L >> A >> B >> C >> D;
	sum = max(A / C + (A%C == 0 ? 0 : 1), B / D + (B%D == 0 ? 0 : 1));
	cout << L - sum << endl;

	return 0;
}

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

int main() {
  int A, B, C, D, L;
  int X, Y;

  cin >> L >> A >> B >> C >> D;

  X = A/C;
  if(A%C != 0)
    X++;
  Y = B/D;
  if(B%D != 0)
    Y++;

  cout << (X>Y) ? (L-X) : (L-Y) << endl;
}

C++: #include<iostream>
#include<string>
#include<algorithm>	
#include<cmath>
using namespace std;
int main() {
	int n, m, a, b, c, sum = 0, num = 0; cin >> n >> m >> a >> b >> c;
	sum = m / b; num = a / c;
	if (m % b != 0) {
		sum++;
	}
	if (a % c != 0) {
		num++;
	}
	cout << n - max(sum, num) << endl;
}

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 Jap = a/c;
		if(a%c != 0){
			Jap += 1;
		}
		int Math = b/d;
		if(b%d != 0){
			Math += 1;
		}

	int day = Jap;
	if(Jap < Math) {
		day = Math;
	}

	cout << l - day << endl;

	return 0;
}

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

int  main(){
  int l,a,b,c,d,k,s;
  cin>>l>>a>>b>>c>>d;
  k=a/c;
  s=b/d;
  if(a%c!=0)k++;
  if(b%d!=0)s++;
  if(k>s)cout<<l-k<<endl;
  else cout<<l-s<<endl;
  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-1)/d,(c+e-1)/e)<<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;
}
if(E>F){
K=L-F;
}
if(E=F){
K=L-E;
}
cout<<K<<'\n';
return 0;
}

C++: #include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define REP(i,n) for (int i=0;i<(n);i++)
#define INF (1<<29)
using namespace std;
typedef long long ll;
int main(){
      int l,a,b,c,d;
      cin>>l>>a>>b>>c>>d;
      cout<<l-max((a+c-1)/c,(b+d-1)/d)<<endl;
}

C++: 
#include <iostream>
using namespace std;
int main(){
	int L,A,B,C,D;
	cin >> L >> A >> B >> C >> D;
		int x=(A+C-1)/C;
		int y=(B+D-1)/D;
		cout << L-max(x,y) << endl;
		return 0;

}

C++: #include"bits/stdc++.h"
using namespace std;

int main(){

	int answer;
	int A,B,C,D,L;
	int math, Japanese;

	cin >> L >> A >> B >> C >> D;
	
	math = (B - 1) / D + 1;
	Japanese = (A - 1) / C + 1;

	cout << L - max(math, Japanese) << endl;


	/*
	int datanum = 0;
	for(int dataset = 0; dataset < 1; dataset++){
		if(input == 0) break;


		answer[dataset] = sum;

		datanum++;
	}

	for(int dataset = 0; dataset < datanum; dataset++){
		cout << answer[dataset] << endl;
	}
	*/

	

	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int l,a,b,c,d,h1,h2;
	cin >> l;
	cin >> a;
	cin >> b;
	cin >> c;
	cin >> d;
	if(a%c==0)h1=a/c;
	else h1=a/c+1;
	if(b%d==0)h2=b/d;
	else h2=b/d+1;
	if(h1>h2)cout << l-h1 << endl;
	else if(h1<h2)cout << l-h2 << endl;
	else cout << l-h2 << endl;
	return 0;
}

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

int main(){
	int d, j, m, jp, mp;
	cin >> d;
	cin >> j >> m;
	cin >> jp >> mp;
	j = j / jp  + (j % jp > 0); m = m / mp + (m % mp > 1);

	cout << d - max(j, m) << endl;
}

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(a/c + !!(a%c), b/d + !!(b % d)) << 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;
	cout << l -max((a+c-1)/c, (b+d-1)/d) << endl;
	return 0;
}