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

int max( int a, int b )
{
    if( a > b )
        return a;
    else
        return b;
}

int days( int a, int b )
{
    if( a % b != 0 )
        return a / b + 1;
    else
        return a / b;
}

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

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

    cout << l - max( days( a, c ), days( b, d ) ) << endl;

    return 0;
}

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

int day(int M, int N){
    if(M % N == 0) return (M / N);
    return (M / N + 1);
}

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

    if(day(A, C) >= day(B, D)) cout << (L - day(A, C)) << endl;
    else cout << (L - day(B, D)) << endl;

}

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

int main()
{
	int l;
	cin>>l;
	2<=l&&l<=40;
	
	int a;
	cin>>a;
	1<=a&&a<=1000;
	
	int b;
	cin>>b;
	1<=b&&b<=1000;
	
	int c;
	cin>>c;
	1<=c&&c<=100;	

	int d;
	cin>>d;
	1<=d&&d<=100;
	
	double jpn;
	jpn=a%c;
	double math;
	math=b%d;
	
	if(jpn>0){
		if(math>0){
			if(jpn+math>1.0){		
				if(a/c>b/d){
				cout<<(l-a/c)+2<<"\n";
				}
			}
		}
	}
	if(jpn>0){
		if(math>0){
			if(jpn+math>1.0){		
				if(b/d>a+c){
				cout<<(l-b/d)+2<<"\n";
			}
		}
	}
	if(jpn>0){
		if(math>0){
			if(jpn+math<=1.0){		
				if(a/c>b/d){
				cout<<(l-a/c)+1<<"\n";
				}
			}
		}
	}
	if(jpn>0){
		if(math>0){
			if(jpn+math<=1.0){		
				if(b/d>a/c){
				cout<<(l-b/d)+1<<"\n";
				}
			}
		}
	}
	
	if(jpn=0){
		if(math=0){	
				if(b/d>a/c){
				cout<<l-b/d<<"\n";
			}
		}
	}

	if(jpn=0){
		if(math=0){		
				if(a/c>b/d){
				cout<<(l-a/c)+1<<"\n";
			}
		}
	}
}
	return 0;
}

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

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

C++: #include <bits/stdc++.h>
using namespace std;
int a, b, c, d, e;
int main() {
	cin >> a >> b >> c >> d >> e;
	cout << a - max((b + d - 1) / d, (c + e - 1) / e) << endl;
	return 0;
}

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

C++: #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define SORT(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
int main()
{
	int l,a,b,c,d;
	cin >> l >> a >> b >> c >> d;
	cout << l-max(a/c+(a%c==0?0:1),b/d+(b%d==0?0:1)) << endl;
	return 0;
}

C++: #include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
using namespace std;
#define INF 100000000
typedef long long ll;

int L, A, B, C, D;

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

    return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>

using namespace std;

int main(){
	int L,a,b,c,d,temp;
	int doo,doo1,doo2;
	double dtemp;
	
	scanf("%d",&L);
	scanf("%d",&a);
	scanf("%d",&b);
	scanf("%d",&c);
	scanf("%d",&d);
	dtemp = a/c;
	if(a%c==0)
	doo1=(int)dtemp;
	else
	doo1=(int)dtemp+1;
	//
	dtemp = b/d;
	if(b%d==0)
	doo2=(int)dtemp;
	else
	doo2=(int)dtemp+1;
	if(doo1>doo2)
	doo=doo1;
	else
	doo=doo2;
	printf("%d\n",L-doo);
}

C++: #include <iostream>

using namespace std;

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

  if(a/c >= b/d){
    e = l-a/c;
    if(a%c != 0 ){
      e--;
    }
  }else{
    e = l-b/d;
    if(b%d != 0){
      e--;
    }
  }

  cout << e << endl;

  return 0;
}

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

int main()
{
	int l;
	cin>>l;
	2<=l&&l<=40;
	
	int a;
	cin>>a;
	1<=a&&a<=1000;
	
	int b;
	cin>>b;
	1<=b&&b<=1000;
	
	int c;
	cin>>c;
	1<=c&&c<=100;	

	int d;
	cin>>d;
	1<=d&&d<=100;
	
	int jpn;
	jpn=a%c;
	int math;
	math=b%d;
	
	if(jpn>0){
		if(math>0){
			if(jpn+math>1.0)		
				if(a/c>b/d){
			cout<<(l-a/c)+<<"\n";
		}
	}

	if(jpn<0){
		if(a/c>b/d){
			cout<<l-a/c<<"\n";
		}
	}

	if(math>0){
		if(b/d>a/c){
			cout<<(l-b/d)+1<<"\n";
		}
	}


	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <ctime>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <cstring>
#include <vector>
#include <algorithm>
#include <functional>
#include <fstream>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <numeric>
#include <cassert>
using namespace std;
static const double EPS = 1e-10;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define all(a) a.begin(),a.end()
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define SS stringstream
#define DBG1(a) rep(_X,sz(a)){printf("%d ",a[_X]);}puts("");
#define DBG2(a) rep(_X,sz(a)){rep(_Y,sz(a[_X]))printf("%d ",a[_X][_Y]);puts("");}
#define bitcount(b) __builtin_popcount(b)
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)

#define delete(a,n) a.erase(remove(all(a),n),a.end())
template<typename T, typename S> vector<T>& operator<<(vector<T>& a, S b) { a.push_back(b); return a; }
template<typename T> void operator>>(vector<T>& a, int b) {while(b--)if(!a.empty())a.pop_back();}
bool isprime(int n){ if(n<2)return false;  for(int i=2;i*i<=n;i++)if(n%i==0)return false;  return true;} 
ll b_pow(ll x,ll n){return n ? b_pow(x*x,n/2)*(n%2?x:1) : 1ll;}
string itos(int n){stringstream ss;ss << n;return ss.str();}

long long in(){
	long long n;
	scanf("%lld",&n);
	return n;
}


//owari
int main(){
	//ios_base::sync_with_stdio(false);
	int L;
	cin >> L;
	int A,B,C,D;
	cin >> A >> B >> C >> D;
	int X = max( (A+C-1) / C , (B+D-1) / D );
	cout << max(0,L - X) << endl;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <sstream>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstring>
#include <cmath>
#include <cstdio>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

typedef long long ll;

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%C!=0)) << endl;
    return 0;
}