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(){
	int a,b,c,d,l,off,kokugo=0,sansu=0,i;   
	scanf("%d",&l);
	scanf("%d",&a);
	scanf("%d",&b);
	scanf("%d",&c);
	scanf("%d",&d);
	for(i=0;i<a;i+=c){
		kokugo=kokugo+1;
	} 
	for(i=0;i<b;i+=d){
             sansu=sansu+1;
	}
         if(kokugo<=sansu){
		off=l-sansu;
	}else{
		off=l-kokugo;
	}
         printf("%d\n",off);
         return 0;
}

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

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

C++: #include <iostream>
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)/B) << 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 - 1) / c, (b + d - 1) / d) << endl; 
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define Rep(i,N) for(int i = 0;i < N;i++)

int main()
{
  int L;
  int A, B, C, D;
  cin >> L;
  cin >> A >> B >> C >> D;
  cout << L - max((A + C - 1) / C,(B + D - 1) / D) << endl;
  return 0;
}

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

#define int long long int
#define main signed main()
#define bye return 0
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define each(p, v) for (auto p = (v).begin(); p != (v).end(); p++)
#define all(v) (v).begin(), (v).end()
#define prec(n) fixed << setprecision(n)
#define dump(x) cerr << "(L" << __LINE__ << ") " << #x << " = " << (x) << endl
#define clr(x, a) memset(x, a, sizeof(x))

#define sum(v) accumulate(all(v), 0)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define odd(n) ((n) % 2)
#define even(n) (!odd(n))

#define INF 1000000000
#define MOD 1000000007

#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define vi vector<int>
#define vb vector<bool>
#define vc vector<char>

using namespace std;

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;
  bye;
}

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

int main(){
	int l;
	double a,b,c,d;
	cin>>l>>a>>b>>c>>d;
	double e=c/a;
	double f=ceil(e);
	double g=d/b;
	double h=ceil(g);
	
	(int)f;
	(int)h;
	if(f>h||f==h)
	cout<<l-f<<endl;
	else if(f<h)
	cout<<l-h<<endl;
	
	return 0;
	}

C++: #include<iostream>
#include<cmath>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
	int L,A,B,C,D;//L:winter vacation A:Japanese homework B:math homework
	cin>>L>>A>>B>>C>>D;
	int spentA=A/C+1;
	int spentB=B/D+1;
	cout<<spentA<<" "<<spentB<<endl;
	cout<<L-max(spentA,spentB)<<endl;
	return 0;
}

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

using namespace std;

#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define repr(i, j) for(int i = j; i >= 0; --i)
#define INF (1 << 30)
#define MOD 1e9 + 7

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

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

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

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

int main(){

	int a,b,c,d,l,x,y,z;
	cin >> l >> a >> b >> c >> d;

	if( a%c > 0 ){
		x = a/c+1;
	}
	else{
		x = a/c;
	}
	if( b%d > 0 ){
		x = b/d+1;
	}
	else{
		x = b/d;
	}

	z = max( x , y );
	
	cout << l-z << endl;

	return 0;
}

C++: #include <stdio.h>
int main(void)
{
	int l,a[2],b[2],i,m=0;
	scanf("%d",&l);
	scanf("%d%d %d%d",&a[0],&a[1],&b[0],&b[1]);
	for(i=0;i!=2;++i){
		if(m<a[i]/b[i]){
			if(0==a[i]%b[i])
				m=a[i]/b[i];
			else
				m=a[i]/b[i]+1;
		}
	}
	printf("%d\n",l-m);
}

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

#define int long long int
#define rep(a,b,c) for(int a=b;a<c;a++)
#define repm(a,b,c) for(int a=(b-1);a>=c;a--)
#define pb push_back
#define str string
#define sf(a) scanfs("%d",&a)
#define pb push_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) (v).begin(), (v).end()

using namespace std;

const int INF = 1e18 + 9;
const int Mod = 1e9 + 7;
inline int replac(str s){double ans=0;rep(i,0,s.length()){ans+=(s[i]-'0')*pow(10,s.length()-i-1);}return (int)ans;}
inline string numstr(int m){str s="";while(m>0){char c;int a=m/10;if(a>0)a=m%(a*10);else a=m;c=(char)('0'+a);s+=c;m/=10;}str st="";for(int i=s.size()-1;i>=0;i--){st+=s[i];}return st;}
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector<pii> vii;

signed main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,a,a1,b,b1;
    cin >> n >> a >> b >> a1>> b1;
    n-=max((a/a1+1),(b/b1+1));
    cout << n << endl;
    return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>
#include <cmath>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<30
#define pb push_back
#define mp make_pair

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int main() {
	double l, a, b, c, d;
	cin >> l >> a >> b >> c >> d;

	cout << l - max(ceil(a / c), ceil(b / d)) << endl;

	return 0;
}

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

int main(){

 int a,b,c,d,e,f,g;
 cin>>a>>b>>c>>d>>e;

 if(b%d==0)
  f = b/d;
 else
  f = b/d+1;
 
 if(c%e==0)
  g = c/e;
 else
  g = c/e+1;
 
 if(f>=g)
  cout<<a-f<<'\n';
 else
  cout<<a-g<<'\n';

return 0;
}

C++: #include <iostream>

using namespace std;

int main(){
	int day, a, b, a1, b1, x, y;
	cin >> day >> a >> b >> a1 >> b1;

	x = a / a1;
	y = b / b1;

	if (a % a1 != 0) x += 1;
	if (b % b1 != 0) y += 1;

	if (x > y) printf("%d\n", day - x);
	else printf("%d\n", day - y);

	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <sstream>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstring>
#include <cmath>
#include <cstdio>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

typedef long long ll;

int main(){
    int L,A,B,C,D;
    cin >> L >> A >> B >> C >> D ;
    cout << L - max(A/C+(A%C!=0),B/D+(B%D!=0)) << endl;
    return 0;
}

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

int main(){
  int day;
  cin>>day;
  int A,B,C,D;
  cin>>A>>B>>C>>D;
  int ans1,ans2;
  ans1=A/C;
  if(A-A%C!=A) ans1+=1;
  ans2=B/D;
  if(B-B%D!=B) ans2+=1;
          
  int ans=max(ans1,ans2); 
  cout<<day-ans<<endl;
  
  return 0;
}

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

#define reps(i,f,n) for(int i = f; i < int(n); i++)
#define rep(i,n) reps(i,0,n)
using namespace std;

int main(void){
	
	int L, A, B, C, D;
	
	cin >> L >> A >> B >>C >>D;
	
	rep(i, L+1){
		if(C*i>=A && D*i>=B){
			printf("%d\n", L-i);
			break;
		}
	}
	
	return 0;
}