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<cstdio>
#include<algorithm>

using namespace std;

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

	scanf("%d%d%d%d%d",&l,&a,&b,&c,&d);
	int ans = l;

	ans = min(ans,l-(a+c-1)/c);
	ans = min(ans,l-(b+d-1)/d);

	printf("%d\n",ans);
	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)f=b/d+1;
  else f=b/d;
  if(c%e)g=c/e+1;
  else g=c/e;
  cout<<a-max(f,g)<<endl;
}

C++: #include <iostream>

using namespace std;


int main(){

  int a,b,c,d,l,sum=0,e,f;

 cin >> l >> a >> b >> c >> d ;
 
while(1){

  if(a<c){
    f=1;
  }

  if(f==1){
    break;
  }
 c+=c;

 sum++;
 }

while(1){

  if(b<d){
    e=1;
  }

  if(e==1){
    break;
  }
 d+=d;

 sum++;
 }

 cout << l-sum <<'\n';


 return 0;
}

C++: //============================================================================
// Name        : AOL.cpp
// Author      : Akari Fujii
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;

int main() {
	int a,b,c,d,l,n;
	cin>>l>>a>>b>>c>>d;
	int kokugo,sansuu,ooihou;
    kokugo=a/c;
    if( a%c>0)kokugo+=1;
    sansuu=b/d;
    if( b%d>0)sansuu+=1;
    n=kokugo;
    if( kokugo<sansuu)n=sansuu;
    cout<<l-n<<endl;

}

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

int main(){
  int a;
  int i;
  int u;
  int e;
  int o;
  int ka;
  int ki;
  cin>>a>>i>>u>>e>>o;

  ka=i/e;
  if(i%e>0){
    ka=ka+1;
  }
  ki=u/o;
  if(u%o>0){
    ki=ki+1;
  }

  cout<<a-ka-ki<,endl;
}

C++: #include "bits/stdc++.h"
#define rep(i,a,n) for(int i = (a);i < (n);i++)
typedef unsigned long long ull;
typedef long long ll;
using namespace std;

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

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

int main() {
	int L,A,B,C,D;
	cin >> L >> A >> B >> C >> D;
	int X,Y;
	if(A%C!=0){
		X=A/C+1;
	}
	else X=A/C;
	if(B%D!=0){
		Y=B/D+1;
	}
	else Y=B/D;
	int Z;
	if(X>=Y){
		Z=X;
	}
	else Z=Y;
	cout << L-Z << endl;
	// your code goes here
	return 0;
}

C++: #include <iostream>
#include <math.h>
using namespace std;
int main(){
	int l,a,b,c,d,mday,jday,ans;
	cin>>l>>a>>b>>c>>d;
	if(a%c==0)jday=a/c;
	else jday=(a/c)+1;
	if(b%d==0)mday=b/d;
	else mday=(b/d)+1;
	//cout<<jday<<" "<<mday<<endl;
	ans=max(jday,mday);
	//cout<<ans<<endl;
	cout<<l-ans<<endl;
}

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) / C + 1;
	Japanese = (B - 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>
#include<string>
using namespace std;
int main(){
    int l,a,b,c,d;
    cin>>l>>a>>b>>c>>d;
    if((a+c-1)/c>=(b+d-1)/d){
      cout<<l-(a+c-1)/c<<endl;
    }
    else{
          cout<<l-(b+d-1)/d<<endl;
    }
    return 0;
}

C++: #include <iostream>
#include <math.h>
using namespace std;
int main(){
	int l,a,b,c,d,mday,jday,ans;
	cin>>l>>a>>b>>c>>d;
	if(a%c==0)jday=a/c;
	else jday=(a/c)+1;
	if(b%d==0)mday=b/d;
	else mday=(b/d)+1;
	cout<<jday<<" "<<mday<<endl;
	ans=max(jday,mday);
	cout<<ans<<endl;
	cout<<l-ans<<endl;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
main(){
  int l,a,b,c,d;
  cin>>l>>a>>b>>c>>d;
  int x,y;
  x=a/c;
  if(a%c!=0){
    x++;
  }
  y=b/d;
  if(b%d!=0){
    y++;
  }
  cout<<l-max(x,y)<<endl;
}

C++: #include<stdio.h>
#include<string>
#include<stdlib.h>
#include<math.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<string.h>

using namespace std;

typedef pair<int,int> pii;

#define rep(i,j) for(int i=0;i<(j);i++)
#define reps(i,j,k) for(int i=j;i<=k;i++)


int main(){
	int a,b,c,d,l,cnt=0;
	scanf("%d%d%d%d%d",&l,&a,&b,&c,&d);
	while(a>0 || b>0){
		a-=c;
		b-=d;
		cnt++;
	}
	printf("%d\n",l-cnt);
	return 0;
}

C++: #include<iostream>
#include<vector>
#include<string>
#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;
}

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(void)
{
	int a,b,c,d,e,f,x,y,l,n;
	scanf("%d",&l);
	scanf("%d",&a);
	scanf("%d",&b);
	scanf("%d",&c);
	scanf("%d",&d);
	x=a/c;
	y=b/d;
	if(a%c>0){
		x=x+1;
	}
	if(b%d>0){
		y=y+1;
	}
	if(x>y){
		n=l-x;
		printf("%d\n",n);
	}
	else{
		n=l-y;
		printf("%d\n",n);
	}
	
	return 0;
}

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

#define X first
#define Y second
#define pb push_back
#define eb emplace_back
#define mkp make_pair
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define per(i, a, b) for (int i = (a); i >= (b); --i)

using namespace std;

using I = int;
using L = long;
using F = float;
using D = double;
using S = string;
using SS = stringstream;
using C = char;
using LL = long long;
using VI = vector<int>;
using VL = vector<long>;
using VF = vector<float>;
using VS = vector<string>;
using VVL = vector<vector<long>>;
using PLL = pair<long, long>;
using PLF = pair<long, float>;
using PLS = pair<long, string>;
using PSL = pair<string, long>;
using PSF = pair<string, float>;
using PSS = pair<string, string>;
using MLL = map<long, long>;
using MLF = map<long, float>;
using MLS = map<long, string>;
using MSL = map<string, long>;
using MSF = map<string, float>;
using MSS = map<string, string>;

const long kMax2 = 109;
const long kMax3 = 1009;
const long kMax4 = 10009;
const long kMax5 = 100009;
const long kMax6 = 1000009;
const long kInfI = 0x3F3F3F3F;
const float kInfF = 1e15;

template <class T>
void PrintVector(vector<T> & v, unsigned n) {
  rep(i, 0, n - 1) {
    cout << v[i] << " ";
  }
  cout << endl;
}

int main(int argc, char const *argv[]) {
  L l, a, b, c, d;
  cin >> l >> a >> b >> c >> d;

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

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

int main(void)
{
  int l, a, b, c, d;
  cin >> l >> a >> b >> c >> d;
  int ja = a/c + (a%c == 0 ? 0 : 1);
  int ma = b/d + (b%d == 0 ? 0 : 1);
  int result = l - (ja<ma ? ma : ja);
  cout << result << endl;
  return 0;
}

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

int main(){
  int j,m,jt,mt,d,a=0;
  cin >> d >> j >> m >> jt >> mt;
  while(j > 0 || m > 0){ a++;
    j -= jt; m -= mt;
  }
  cout << d - a << endl;
}

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