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 <climits>
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <stack>
#include <algorithm>
#include <random>
#include <iomanip>
#include <map>
#include <queue>
#include <functional>
#include <numeric>
#include <chrono>
#include <cstdlib>
using ll = long long;
using namespace std;

const ll MOD = 1e9 + 7;
const double pi = acos(-1);
typedef pair<int, int> P;
#define REP(i, n) for (int(i) = 0; (i) < (n); ++(i))
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define EPS 1e-4
#define OUTPUT(i) (cout << (ll)i << endl)
#define ALL(a) ((a).begin(), (a).end())

bool operator<(const pair<ll, ll> &a, const pair<ll, ll> &b)
{

    if (a.first == b.first)
        return a.second < b.second;

    return a.first < b.first;
}

ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}

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

    //cout << fixed << setprecision(15);

    int L;
    cin >> L;

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

    return 0;
}

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

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

int main(){

  int L,A,B,C,D,day[2];

  cin >> L >> A >> B >> C >> D;
  day[0] = A/C;
  if(day[0]*C != A){
    day[0]++;
  }
  day[1] = B/D;
  if(day[1]*D != B){
    day[1]++;
  }
  sort(day,day+1);
  
  cout << L-day[1] << endl;
}

C++: #include<iostream>
using namespace std;
int main(void)
{
    int L,A,B,C,D;
    cin>>L>>A>>B>>C>>D;
    if(A/C>=B/D&&A%C!=0)cout<<L-(A/C+1)<<"\n";
    else if(A/C<B/D&&B%D!=0)cout<<L-(B/D+1)<<"\n";
    else if(A/C>=B/D)cout<<L-A/C<<"\n";
    else cout<<L-B/D<<"\n";
}

C++: #include <iostream>
using namespace std;
int main(void){
	int l,a,b,c,d,p,q,ans;
	cin>>l>>a>>b>>c>>d;
	p=a/c;a=a%c;p+=(a)?1:0;
	q=b/d;b=b%c;q+=(b)?1:0;
	cout<<l-((p>q)?p:q)<<endl;
	return 0;
}

C++: #include<iostream>
using namespace std;
double max(double a, double b) {
	if (a > b)return a;
	else return b;
}
int main()
{
	int ans;
	double l, a, b, c, d,res;
	cin >> l>>a >> b >> c >> d;
	res=max(a / c, b / d);
	if (res != (int)res)ans=l-(int)(res + 1);
	else ans = l - res;
	cout << ans << endl;
    return 0;
}

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

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

	int l, a, b, c, d;
	cin >> l >> a >> b >> c >> d;
	cout << l - max((a + c - 1) / c, (b + d - 1) / d) << endl;

	return EXIT_SUCCESS;
}

C++: #include <iostream>

using namespace std;

int main(){
	int a;
	int b;
	int c;
	int d;
	int e;
	cin>>a;
	cin>>b;
	cin>>c;
	cin>>d;
	cin>>e;
	int f=b/d+1;
	int g=c/e+1;
	if(f>g)
	{
	   cout<<a-f<<endl;
	}
	else if(g>f)
	{
	   cout<<a-g<<endl;
	}
	else if(g=f)
	{
	   cout<<a-g<<endl;
	}

	return 0;
}

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

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

    cin>>L>>a>>b>>c>>d;

    cout<<max(L-max((a+c-1)/c,(b+d-1)/d),0)<<endl;

    return 0;
}

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 << 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<bits/stdc++.h>
using namespace std;
int main(){
  int day,j,m,jp,mp;
  cin>>day>>j>>m>>jp>>mp;
  int jans,mans;
  jans=j/jp;
  if(j%jp!=0)jans++;
  mans=m/mp;
  if(m%mp!=0)mans++;
  cout<<day-max(jans,mans)<<endl;
}

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

C++: #include <stdio.h>


int main(){
	int a,b,c,d,l,ac,bd,ans;
	scanf("%d%d%d%d%d",&l,&a,&b,&c,&d);
	ac = a / c + 1;
	bd = b / d + 1;
	if(ac < bd){
		ans = l - bd;
	}else{
		ans = l - ac;
	}
	printf("%d\n",ans);
	return 0;

}

C++: #include<iostream>
using namespace std ;
int main( void )
{
	short holy ;
	short jap ,math ;
	short japrite ,mathrite ;
	short amari ;
	cin >> holy ;
	cin >> jap ;
	cin >> math ;
	cin >> japrite ;
	cin >>mathrite ;
	amari = jap % japrite > 0 ? 1 : 0 ;
	jap = ( jap / japrite ) + amari ;
	amari = math % mathrite > 0 ? 1 : 0 ;
	math = ( math / mathrite ) + amari ;
	holy -= jap > math ? jap : math ;
	cout << holy << endl ;
	return 0 ;
}

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

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

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

  e=a/c; m=a%c;
  if (m!=0) e++;

  f=b/d; m=b%c;
  if (m!=0) f++;

  if(e>f){
    cout << l-e << endl;
  } else {
    cout << l-f << endl;
  }

  return 0;
}

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

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

using pii = pair<int, int>;
using vi = vector<int>;
using ll = long long;

int main() {
    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 <iostream>
using namespace std;

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

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

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

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

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

C++: #include<iostream>
using namespace std;
int main(){

  int A,B,C,D,L,Amin,Bmin;

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

  Amin=A/C;
  Bmin=B/D;

  if(A%C != 0)
    Amin++;
  if(B%D != 0)
    Bmin++;

  if( Amin >= Bmin ){
    cout <<L-Amin<<endl;
  }else{
    cout <<L-Bmin<<endl;
  }

  return 0;
}

C++: // AOJ 0576
#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 - 1) / c, (b + d - 1) / d) << endl;

	return 0;
}

C++: //
//  main.cpp

#include <iostream>
using namespace std;


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

	int L1 = A / C;
	if(A%C != 0)L1++;
	int L2 = B / D;
	if(B%D != 0)L2++;
	
	cout << L - max(L1,L2) << endl;
	return 0;
}