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++: #define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);
const double EPS = 1e-10;

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

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

using namespace std;

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

C++: include <stdio.h>
int main(){
  int l,a,b,c,d,p,i;
  scanf("%d %d %d %d %d",&l,&a,&b,&c,&d);
  for(i = 1 ; a > c || b > d ; i++){
    a = a-c;
    b = b-d;
  }
  p = l - i;
  printf("%d\n",p);
  return 0;
}

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

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

    cin >> L;
    cin >> A;
    cin >> B;
    cin >> C;
    cin >> D;
    int finish_JA = 0;
    int finish_arith = 0;

    while (A > 0){
       A -= C;
       finish_JA++;
    }
    while (B < 0){
        B -= D;
        finish_arith++;
    }

    cout << L - (finish_arith + finish_JA) << 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 days_jp , days_mt , days;
  days_jp = (A / C) + 1;
  days_mt = (B / D) + 1;
  days = (days_jp > days_mt) ?  days_jp : days_mt;

  cout << L - days;


  return 0;
}

C++: // 2013/11/08 Tazoe

#include <iostream>
using namespace std;

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

	int E = A/C;
	if(A%C!=0){
		E++;
	}

	int F = B/D;
	if(B%D!=0){
		F++;
	}

	int G;
	if(E>=F){
		G = L-E;
	}
	else{
		G = L-F;
	}

	cout << G << endl;

	return 0;
}

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

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

	while(a > 0 || b > 0){
		if(a > 0)
			a -= c;
		if(b > 0)
			b -= d;
		l--;
	}

	cout << l << endl;

	return 0;
}

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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD

int main(){
  int l,a,b,c,d;
  cin>>l>>a>>b>>c>>d;
  int ko = (a/c) + (int)(a%c!=0);
  int ei = (b/d) + (int)(b%d!=0);
  int r = max(ko,ei);
  cout<<(l-r)<<endl;
  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

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

    cin >> L >> A >> B >> C >> D;
    cout << L - max(ceil((double)A / C), ceil((double)B / D)) << endl;

    return 0;
}

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

C++: #include <stdio.h>
#include <algorithm>

int L, A, B, C, D;

int main(void) {
	scanf("%d%d%d%d%d", &L, &A, &B, &C, &D);

	if (A%C == 0) { A /= C; }
	else { A = A / C + 1; }
	if (B%D == 0) { B /= D; }
	else { B = B / D + 1; }

	printf("%d\n", L - std::max(A, B));
	return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
const ll INF=1e18;
const ll MOD=1e9+7;
const double pi=acos(-1);
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);  
  
  int l,a,b,c,d;
  cin >> l >> a >> b >> c >> d;
  cout <<max(0,l-max((a+c-1)/c,(b+d-1)/d)) << endl;
}

C++: #include<stdio.h>
#define max(A,B) (A>B?A:B)
int l,a,b,c,d;
main(){scanf("%d%d%d%d%d",&l,&a,&b,&c,&d);printf("%d\n",l-max(a/c+!!a%c,b/d+!!b%d));return 0;}

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), b / d + !!(b % d)) << endl;
    return 0;
}

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

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

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

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

C++: #include <iostream>
#include <algorithm>
int main() {
	int l; // ??¬???????????\??°
	int a, b, c, d;
	int koku, san;
	std::cin  >> l >> a >> b >> c >> d;
	koku = b / d;
	san = a / c;

	l = l - std::max(koku, san);
	
	std::cout << l << std::endl;

	return 0
}

C++: #include <iostream>
#include <algorithm>
#include <cmath>

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 day = max(ceil((double)a / c), ceil((double)c / d));
	int ans = l - day;
	cout << ans << endl;

	return 0;
}

C++: #include <cstdio>
#define MAX(a,b)((a)>=(b)?(a):(b))
int main() {
	int a,b,c,d,L;
	scanf("%d %d %d %d %d",&L,&a,&b,&c,&d);
	printf("%d\n",L-MAX((a+c-1)/c,(b+d-1)/d));
}

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

int main() {
  int h, j, m, j1,m1, x, y;
  cin >> h >> j >> m >> j1 >> m1;

	if(j%j1 >= 1){
	x = j/j1 + 1
}
        else{
	x = j/j1
}

	if(m%m1 >= 1){
	x = m/m1 + 1
}
        else{
	x = m/m1
}

  cout << h - max(x,y) << endl;
  
  return 0;
}

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

int main() {
	int l, a, b, c, d, f = 0,  h = 0;
	cin >> l >> a >> b >> c >> d;
	while (true) {
		if (a <= 0) {
			break;
		}
		a = a - c;
		f = f + 1;
	}
	while (true) {
		if (b <= 0) {
			break;
		}
		b = b - d;
		h= h + 1;
	}
	if(f<h){
		cout<<l-h<<endl;
	}
	else{
		cout<<l-f<<endl;
	}
	return 0;
}