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 rep(i,n) for (int i =0; i < (n); ++i)
using namespace std;

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

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

        int M, G;
        G = A / C;
        if (A % C) G++;
        M = B / D;
        if (B % D) M++;

        cout << L - max(M, G) << endl;
        return 0;
}

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

int main(){
	int L,A,B,C,D,x,y;
	cin >>L >>A >>B >>C >>D;
	if(A%C==0)
		x=A/C;
		else
			x=A/C+1;
	if(B%D==0)
		y=B/D;
		else
			y=B/D+1;
	if(x<y)
		x=y;
		
	cout << L-x;

	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 <bits/stdc++.h>
using namespace std;

const int INF = 1000000007;
const int MOD = 1000000007;

typedef long long ll;
typedef pair<int, int> pr;

int main(){
    int l, a, b, c, d;
    scanf("%d%d%d%d%d", &l, &a, &b, &c, &d);
    printf("%d\n", min(l - --a/c - 1, l - --b/d - 1));
    return 0;
}

C++: #include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <iterator>
using namespace std;

/*
const int MAX=1000;
vector<vector<int> > memo(MAX,vector<int>(MAX));
vector<vector<int> > done(MAX,vector<int>(MAX));
int dfs(vector<vector<int> > vi,int i,int j,int sum);

int main(){
	//ios::sync_with_stdio(false);
	//cin.tie(0);
	int m,n;
	while(cin>>m>>n&&m!=0&&n!=0){
		vector<vector<int> > ice(m,vector<int>(n));
		int ans=0;
		for(int i=0; i<MAX; ++i){
			for(int j=0; j<MAX; ++j){
				memo[i][j]=0;
				done[i][j]=0;
			}
		}
		for(int i=0; i<n; ++i){
			for(int j=0; j<m; ++j){
				cin >> ice[j][i];
			}
		}
		for(int i=0; i<n; ++i){
			for(int j=0; j<m; ++j){
				if(ice[i][j]==1) {
					ans=max(ans,dfs(ice,i,j,0));
				}
			}
		}
		cout << ans << "\n";
	}
	return 0;
}

int dfs(vector<vector<int> > vi,int i,int j,int sum){
	if(done[i][j]==1) return memo[i][j];
	if(i+1>=vi.size()&&j+1>=vi[i].size()&&i-1<0&&j-1<0&&vi[i+1][j]==0&&vi[i][j+1]==0&&vi[i-1][j]==0&&vi[i][j-1]==0) return sum;
	done[i][j]=1;
	++sum;
	if(i+1<vi.size()) memo[i][j]=dfs(vi,i+1,j,sum+1);
	if(j+1<vi[i].size()) memo[i][j]=dfs(vi,i,j+1,sum+1);
	if(i-1>=0) memo[i][j]=dfs(vi,i-1,j,sum+1);
	if(j-1>=0) memo[i][j]=dfs(vi,i,j-1,sum+1);
	return memo[i][j]; 
}
*/

int main(){
	int l,a,b,c,d;
	cin >> l >> a >> b >> c >> d ;
	int ans=l-max((a+c-1)/c,(b+d-1)/d);
	cout << ans << "\n";
	return 0;
}

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

using namespace std;

main(){
  int l, a, b, c, d;
  scanf("%d%d%d%d%d", &l, &a, &b, &c, &d);
  int e = a / c;
  if(a % c)
    e++;
  int f = b / d;
  if(b % d)
    f++;
  printf("%d\n", l - max(e, f));
  return 0;
}

C++: #include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include <queue>
#include <functional>
#include <sys/timeb.h>
#include <fstream>

using namespace std;


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int l, a, b, c, d;
	cin >> l >> a >> b >> c >> d;
	int ans = l;
	while (a > 0 || b > 0) {
		a -= c;
		b -= d;
		ans--;
	}

	cout << ans << endl;

	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <cmath>
#include <map> 
#include <sstream>
using namespace std;
 
const int MAX= 10000100;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()
#define ll long long int
#define gcd(a,b) __gcd(a,b)

int GCD(int a, int b) {if(!b) return a; return gcd(b, a%b);}
int lcm(int a, int b) {return a*b / gcd(a, b);}

int main(void){
  int l,a,b,c,d;
  cin>>l>>a>>b>>c>>d;
  int res = max(1.0*a/c+0.9,1.0*b/d+0.9);
  cout<<l-res<<endl;
  
}

C++: #include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define rer(i,l,n) for(int i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int,int> pii;

int main(){
	int l,a,b,c,d,x,y;
	cin>>l>>a>>b>>c>>d;
	x=(a%c)?a/c+1:a/c;
	y=(b%d)?b/d+1:b/d;
	o(l-max(x,y));
}

C++: #include<stdio.h>
int main()
{
	int a[101], temp = 0, ruio = 0, ahotoy=0;
	for (int i = 1; i <= 5; i++) {
		scanf("%d", &a[i]);
	}
	while (a[2] > 0 && a[3] > 0) {
		a[2] = a[2] -(a[4] - 2);
		a[3] = a[3] - (a[5] - 2);
		ruio++;
	}
	printf("%d\n", a[1]-ruio);
}

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

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

	cin >> l >> a >> b >> c >> d;

	while (a > 0 && b > 0) {
		a -= c;
		b -= d;
		--l;
	}
	cout << l << endl;
}

C++: #include<bits/stdc++.h>
using namespace std;
int a,b,c,d,e;
int main(){
cin>>a>>b>>c>>d>>e;
cout<<a-max((b+d-1)/d,(c+e-1)/e)<<endl;
}

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

int main() {

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

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

  if( c % e > 0 ) {
    c = c / e + 1;
  } 
  else {
    c = c / e;
  }

  cout << a - max(b, c) << 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>0),B/D+(B%D>0))<<endl;;

return 0;
}

C++: #include<stdio.h>
int main(){
    int kokugo_page,kokugo_max,sugaku_page,sugaku_max,yasumi;
    scanf("%d%d%d%d%d",&yasumi,&kokugo_page,&sugaku_page,&kokugo_max,&sugaku_max);
    printf("%d\n",yasumi-((sugaku_page/sugaku_max+(sugaku_page%sugaku_max==0)?0:1)+(((kokugo_page/kokugo_max)+((kokugo_page%kokugo_max==0)?0:1)))));
    return 0;
}

C++: #include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
typedef pair<int,int> P;
#define make_pair mp
#define first f
#define second s
int n,a,b,c,d;
int main(){
scanf("%d",&n);
scanf("%d %d %d %d",&a,&b,&c,&d);
int e=a%c==0?a/c:a/c+1;
int f=b%d==0?b/d:b/d+1;
printf("%d\r\n",n-max(e,f));
return 0;
}