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>
typedef long long ll;
using namespace std;
int main() {
	int a, b, c, d, e;
	cin >> a;
	cin >> b;
	cin >> c;
	cin >> d;
	cin >> e;
	cout << a - max((b + d - 1) / b,(c + e - 1) / e) << endl;
}

C++: #include<iostream>
#include<math.h>
#include<vector>
using namespace std;
int main()
{
	int a,b,c,d,l,ans;
	cin >> l;
	cin >> a;
	cin >> b;
	cin >> c;
	cin >> d;
	if(a/c > b/d && a%c==0)
	{
		//cout<<"ok1";
		ans=a/c;
	}
	else if(a/c > b/d && a%c!=0)
	{
		//cout<<"ok2";
		ans=(a/c)+1;
	}
	else if(a/c < b/d && a%c==0)
	{
		//cout<<"ok3";
		ans=b/d;
	}
	else
		ans=(b/d)+1;

	cout << l-ans <<endl;


	return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int a, b, c, d, l;
    cin >> l;
    cin >> a;
    cin >> b;
    cin >> c;
    cin >> d;
    
    cout << l - max((a - 1) / c + 1, (b - 1) / d + 1) << endl;
    
}

C++: #include<stdio.h>
#include<math.h>
int main() {
  int a, b, c, d, l, n, x, z;
  scanf("%d %d %d %d %d", &l, &a, &b, &c, &d);
  n = ceil((double)a / (double)c);
  x = ceil((double)b / (double)d);
  if(n >= x) {
    z = l - n;
  }else{
    z = l - x;
  }
  printf("%d\n", z);
  return 0;
}

C++: #include <stdio.h>

int main() {
 int A, B, C, D, L, i, R, cnt = 0;
 scanf( "%d", &L );
 scanf( "%d", &A );
 scanf( "%d", &B );
 scanf( "%d", &C );
 scanf( "%d", &D );
 for( ;; ) {
   A -= C;
   B -= D;
   cnt++;
   if( A <= 0 && B <= 0 ) break;
 }
 R = L - cnt;
 printf( "%d\n", R );
 return 0;
}

C++: #include <iostream>
using namespace std;
int main(void)
{
	int a,b,c,d,e,f,g,A;
	cin>>a>>b>>c>>d>>e;
	if (b%d!=0) f=b/d+1;
	else f=b/d;
	if (c%e!=0) g=c/e+1;
	else g=c/e;
	if (g>f) A=a-g;
	else A=a-f;
	cout<<A<<endl;
}

C++: #include<iostream>
using namespace std;
#include<stdio.h>
int main(void)
{
	int i,f=0,n=0,g=0,a,b,c,d,e;
	cin>>a>>b>>c>>d>>e;
	f=b/d;
	g=c/e;
	if(f>g){
		if(b%d==0)
		cout<<a-f<<endl;
		else
		cout<<a-f-1<<endl;
	}
	else{
		if(c%e==0)
		cout<<a-g<<endl;
		else
		cout<<a-g-1<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
	cin.tie(0); ios::sync_with_stdio(false);
	int A, B, C, D, L; cin >> L >> A >> B >> C >> D;
	int kokugo = A / C, sugaku = B / D;
	if (A%C != 0)kokugo++;
	if (B%D != 0)sugaku++;
	cout << L - max(kokugo,sugaku) << endl;
}

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

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

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

C++: #include<iostream>
using namespace std;
int main(){
  int A,B,C,D,L;
  int J,M;
  int enjoy;
  cin >> L >> A >> B >> C >> D ;
  if(A%C==0){
    J=A/C;
  }else{
    J=A/C+1;
  }
  if(B%D==0){
    M=B/D;
  }else{
    M=B/D+1;
  }
  if(J<M){
    enjoy=L-M;
  }else{
    enjoy=L-J;
  }
  
  cout << enjoy << endl;
  
}

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<string>
#include<functional>
#include<queue>
#include<stack>
#include<math.h>
#define INF 1000000001
#define EPS 1.0e-6

using namespace std;

typedef long long ll;

int a, b, c, d, e;

int main()
{
	cin >> a >> b >> c >> d >> e;

	int kokugo, sansu;
	if (b%d == 0)kokugo = b / d;
	else kokugo = b / d + 1;
	if (c%e == 0)sansu = c / e;
	else sansu = c / e + 1;

	int shukudai = max(kokugo, sansu);

	if (a > shukudai)cout << a - shukudai << endl;
	else cout << 0 << endl;

	return 0;
}

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

using namespace std;

#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define REP3(i, m, n) for(int i = m, i##_len=(n);i < i##_len;i++)
#define FORVEC(i, v) for(int i = 0;i < v.size();i++)

#define INF 1000000000
#define pb(a) push_back(a)
#define llong long long
#define vi vector<int>
#define P pair<int,int>
#define all(vec) (vec.begin()),(vec.end())

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

C++: #include<iostream>
#include<vector>
#include<queue>
#include<map>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
	int k, s, day, K, S, a,b;
	cin >> day >> k >> s >> K >> S;
	if (k%K==0)a= k / K;
	else a= k / K + 1;
	if (s%S==0)b= s / S;
	else b= s / S+1;

	if (b < a)day -= a;
	else day -= b;
	cout << day << endl;

	return 0;
}

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 x = (a+c-1)/c;
  x = max(x,(b+d-1)/d);
  printf("%d\n",l-x);
  return 0;
}

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

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

C++: #include<stdio.h>

int main(){
  int L, A, B, C, D, c, d, e, f;
  scanf("%d %d %d %d %d", &L, &A, &B, &C, &D);
  if(A % C != 0){
    c = A / C + 1;
  }else{
    c = A / C;
  }
  if(B % D != 0){
    d = B / D + 1;
  }else{
    d = B / D;
  }
  if(c > d){
    e = c;
  }else{
    e = d;
  }
  f = L - e;
  printf("%d\n", f);
  return 0;
}

C++: #include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <iterator>
#include <array>
#include <memory>
#include <stack>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
int main(){
    int tino,tiya,kokoa,rize,syaro;
    cin>>tino>>tiya>>kokoa>>rize>>syaro;
    cout<<tino-max((int)((double(tiya)/rize)+1),(int)((double)(kokoa/syaro)+1))<<endl;
}

C++: #include<iostream>
using namespace std;
int maxnum(int x,int y);
int main(){
    int vad,Jp,Js,Jd,Mp,Ms,Md,Hf;
    cin >> vad;
    cin >> Jp;
    cin >> Mp;
    cin >> Js;
    cin >> Ms;
    Jd = Jp / Js + 1;
    Md = Mp / Ms + 1;
    Hf = maxnum(Jd,Md);
    cout << vad - Hf << endl;
    return 0;
}

int maxnum(int x,int y){
    if(x < y){
        return y;
    }
    else if(x > y){
        return x;
    }
    return x;
}