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<iostream>
#include<algorithm>
using namespace std;

int main(){

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

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

#define llong long long
#define inf 999999999
#define mp make_pair
#define pb push_back
#define fn fill_n
typedef pair<int, int> P;
typedef pair<P, int> PP;
typedef pair<PP, int> PPP;
typedef struct data{
	int now;
	int cost;
}data;
int nh[4] = {1, 0, -1, 0};
int nw[4] = {0, 1, 0, -1};





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

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

int main(){
	int l,a,b,c,d;
	cin >> l >> a >> b >> c >> d;
	cout << l - max(ceil((double)a / (double)c),ceil((double)b / (double)d)) << endl;
	return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
using namespace std;
typedef long long ll;
const int INF = 1<<30;
const int MOD = 1e9 + 7;
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 <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <vector>
#include <algorithm>
#include <map>
using std::vector;
using std::sort;

int main(){
	int n, m, d, x, y;
	scanf("%d%d%d%d%d",&d,&n,&m,&x,&y);
	printf("%d\n", d-(int)std::max(ceil((double)n/x),ceil((double)m/y)));
	return 0;
}

C++: #include<stdio.h>

int main(){

int L,A,B,C,D;
int t1,t2;
scanf("%d",&L);
scanf("%d",&A);
scanf("%d",&B);
scanf("%d",&C);
scanf("%d",&D);

t1=A/C;if(A%C!=0)t1++;
t2=B/D;if(B%D!=0)t2++;

if(t2>t1)t1=t2;

L=L-t1;
printf("%d\n",L);
return 0;
}

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

int main() {
	int l,a,b,c,d;
	int m,j;
	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(m>j)l-=m; else l-=j;
	cout<<l<<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 j = a % c != 0 ? a / c + 1 : a / c;
	int m = b % d != 0 ? b / d + 1 : b / d;
	cout<<(j > m ? l - j : l - m)<<endl;
}

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

#define rep(i,n) for(int i=0;i<n;i++)

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

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

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

    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std ;
int main()
{
    int homework[5] = {0} ; //{ day , Japanese , Math , maxJapanesePage , maxMathPage }
    int freeday = 0 ;
    for ( int i = 0 ; i < 5 ; i++ )
    {
        cin >> homework[i] ;
    }
    freeday = homework[0] - max( ceil( (double)homework[1]/homework[3] ) , ceil( (double)homework[2]/homework[4] ) ) ;
    cout << freeday << endl ;

    return 0 ;
}

C++: #include <iostream>

using namespace std;

int main(){
	int day, ja, math, day1, day2, x, y;
	cin >> day >> ja >> math >> day1 >> day2;

	x = ja / day1;
	y = math / day2;

	if (ja % day1 != 0) x += 1;
	if (math % day2 != 0) y += 1;

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

	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int a,b,c,d,l;
	int jp,ma,sum,abc,sa;
	bool bo=false;
	cin>>l>>a>>b>>c>>d;
	if(a%c!=0){
		jp=a/c;
		jp++;
	}
	else{
		jp=a/c;
	}
	if(b%d!=0){
		ma=b/d;
		ma++;
	}
	else {
		ma=b/d;
	}
	if(jp<=ma){
		cout<<l-ma<<endl;
	}else{
		cout<<l-jp<<endl;
	}
	return 0;
}

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

#define times(n, i)      uptil(0, n, i)
#define upto(f, t, i)    for(decltype(t) _##i = (t), i = (f); i <= _##i; i++)
#define uptil(f, t, i)   for(decltype(t) _##i = (t), i = (f); i < _##i; i++)
#define downto(f, t, i)  for(decltype(t) _##i = (t), i = (f); i >= _##i; i--)
#define downtil(f, t, i) for(decltype(t) _##i = (t), i = (f); i > _##i; i--)
#define unless(c) if(!(c))
#define until(c) while(!(c))
#define loop while(true)

#define all(v) v.begin(), v.end()
#define ln << "\n"

struct line{};

template<class T> istream& operator>>(istream& in, vector<T>& v) {
    times(v.capacity(), i) in >> v[i];
    return in;
}

template<class T> const ostream& operator<<(ostream& out, const vector<T>& v) {
    times(v.size(), i) out << (i ? " " : "") << v[i];
    return out;
}

template<class T, class...U> typename enable_if<is_same<T, line>::value, string>::type next(istream& in, const U&... args) {
    string s;
    getline(in, s, args...);
    return move(s);
}

template<class T, class...U> typename enable_if<!is_same<T, line>::value, T>::type next(istream& in, const U&... args) {
    T t(args...);
    in >> t;
    return move(t);
}
template<class T, class...U> auto next(const U&... args) -> decltype(next<T>(cin)) {
    return next<T>(cin, args...);
}

template<class T> T sum(const vector<T>& v) {
    T ans = T();
    for(const T& t : v) ans += t;
    return ans;
}

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

    int L = next<int>(), A = next<int>(), B = next<int>(), C = next<int>(), D = next<int>();
    cout << L - max((A - 1) / C + 1, (B - 1) / D + 1) ln;

    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){
E+=1;
}
if(B/D){
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>

using namespace std;

int main(){

  int l,a,b,c,d;
  int jp=0;
  int ma=0;
  int result;
  
  cin>>l>>a>>b>>c>>d;

  while(1){
	a=a-c;
	jp++;
	if(a<=0)
	  break;
  }

  while(1){
	b=b-d;
	ma++;
	if(b<=0)
	  break;
  }

  result=l-max(jp,ma);

  cout<<result<<endl;

  return 0;
  
}

C++: /*
	0576:Homework
*/
#include	<iostream>
#include	<cmath>

using namespace std;

int main(void) {
	int L, A, B, C, D;
	int day = 1;
	
	cin >> L >> A >> B >> C >> D;
	
	for(day; !(A <= 0, B <= 0); day++) {
		A -= C;
		B -= D;
		if( A <= 0 && B <= 0 ) {
			break;
		}
	}
	
	cout << L - day << endl;
	
	return 0;
}