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>
#include <algorithm>

/*int main(int argc, char **argv)
{
	int a, b, c, d, e;
	std::cin >> a >> b >> c >> d >> e;
	std::cout << std::min(a, std::min(b, c)) + std::min(d, e) - 50 << std::endl;
	return 0;
}*/
int main()
{
	int l, a, b, c, d;
	std::cin >> l >> a >> b >> c >> d;
	int japa, math;
	japa = a / c;
	if(a % c != 0){
		japa++;
	}
	math = b / d;
	if(b % d != 0){
		math++;
	}
	std::cout << l - std::max(japa, math) << std::endl;
}

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

using namespace std;

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

  int res1 = a/c + ((a%c == 0)? 0 : 1);
  int res2 = b/d + ((b%d == 0)? 0 : 1);

  cout << l - max(res1, res2) << endl;

  return 0;
}

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

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

typedef long long ll;
typedef pair<int, int> P;

#define pb push_back
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define mod 1e9+7

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

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

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>

using namespace std;

int main()
{
    int l, a, b, c, d;
    int n=0;
    cin >> l >> a >> b >> c >> d;
    while(a>0||b>0)
    {
        a -= c;
        b -= d;
        ++n;
    }
    cout << l-n << endl;
}

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e16;
const ll mod = 1000000007;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}
ll factorial(ll n) {
  if (n == 1) {
    return 1;
  }
  ll ans = factorial(n-1);
  return ans*n;
}
ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a%b);
}
ll lcm(ll a, ll b) {
  return (a/gcd(a, b))*b;
}
bool is_prime(ll n) {
  for (ll i = 2; i*i <= n; i++) {
    if (n%i == 0) return false;
  }
  return n != 1;
}
ll mod_pow(ll x, ll n, ll mod) {
  if (n == 0) return 1;
  ll res = mod_pow(x*x%mod, n/2, mod);
  if (n & 1) res = res * x % mod;
  return res;
}

int main() {
    ll n, a, b, c, d;
    cin >> n >> a >> b >> c >> d;
    ll tmp1 = 0, tmp2 = 0;
    while (tmp1 < a) {
      tmp1 += c;
    }
    while (tmp2 < b) {
      tmp2 += d;
    }
    cout << n - max(tmp1/c, tmp2/d) << endl;
}

C++: #include <iostream>

using namespace std;

int main(){

	int l , a , b , c , d;
	int ans = 0 , ans2 = 0;
	cin >> l >> a >> b >> c >> d;

	if((a % c) == 0){
		ans += a / c;
	}else{
		ans += a / c + 1;
	}if((b % d) == 0){
		ans2 += a / c;
	}else{
		ans2 += a / c + 1;
	}

	if(ans < ans2) cout << l - ans2 << endl;
	else cout << l - ans << endl;

	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
  int natu,suugaku,kokugo,suu,koku;
  cin >> natu >> kokugo >> suugaku >> koku >> suu;
  int km = (kokugo/koku);
  if(kokugo%koku > 0)km++;
  int sm = (suugaku/suu);
  if(suugaku%suu > 0)sm++;
  if( km > sm ){
    cout << natu-km << endl;
  }else {
    cout << natu-sm << endl; 
  }
  return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int n,a,b,c,d;
	int s,ss;
	scanf("%d",&n);
	scanf("%d",&a);
	scanf("%d",&b);
	scanf("%d",&c);
	scanf("%d",&d);

	s=a/c;
	//printf("s=%d\n",s);
	if(a%c!=0){
	s=s+1;
	//printf("s1=%d\n",s);
	}
	ss=b/d;
	//printf("ss=%d\n",ss);
	if(b%s!=0){
		ss=ss+1;
	//	printf("ss=%d\n",ss);
	}
	
	if(s>=ss){
		n=n-s;
		printf("%d\n",n);
	}
	else if(ss>s){
		n=n-ss;
		printf("%d\n",n);
	}

	return 0;
}

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

int main(){
	/*
	int a,b,c,d,e;

	cin >> a >> b >> c >> d >> e;

	int x;

	if(a > 0){
		x = e*(b-a);
	}
	if(a == 0){
		x = e*b + d;
	}
	if(a < 0){
		x = -c*a + e*b + d;
	}

	cout << x <<endl;
	*/

	/*
	int a,b,c,d,e,f;
	cin >> a >> b >> c >> d >> e >> f;
	int m,n;
	int x = a + b + c + d + e + f;


	
	if(e<f)
	{
		x = x - e;
		if(a<b)
		{
			if(a<c)
			{
				if(a<d)
				{
					cout << x-a << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
			else
			{
					if(c<d)
				{
					cout << x-c << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
		}
		else
		{
			if(b<c)
			{
				if(b<d)
				{
					cout << x-b << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
			else
			{
					if(c<d)
				{
					cout << x-c << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
		}
	}
	else
	{
		x = x - f;
		if(a<b)
		{
			if(a<c)
			{
				if(a<d)
				{
					cout << x-a << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
			else
			{
					if(c<d)
				{
					cout << x-c << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
		}
		else
		{
			if(b<c)
			{
				if(b<d)
				{
					cout << x-b << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
			else
			{
					if(c<d)
				{
					cout << x-c << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
		}
	}
	*/
/*
	int n;
	cin >> n;
	int a;
	cin >> a;
	int max = a,min = a;
	int i = 1;
	while(i<n){
		cin >> a;
		if(a > max){
			max = a;
		}
		if(a < min){
			min = a;
		}
		i++;
	}
	cout << max << endl << min << endl;
	*/
	/*
	string s;
	cin >> s;
	int j,o,i;
	for(int i;i < s.size;i++){
		
	}
	*/
	/*
	int n;
	cin >> n;
	int A;
	int X[100000];
	int n=0;
	for(int i=0;i<n;i++){
		cin >> A;
		
	}
	*/
	/*
	int a,b,c,d,p;
	cin >> a >> b >> c >> d >> p;
	int X,Y=b;

	X = a*p;
	
	if(p>c){
		Y += d*(p-c);
	}

	if(X > Y){
		cout << Y << endl;
	}
	else{
		cout << X << endl;
	}
	*/ 

	int l,a,b,c,d;
	cin >> l >> a >> b >> c >> d;
	int day;

	if(a/c > b/d){
		day = a/c;
		if(a%c != 0){
			day += a%c;
		}
	}else{
		day = b/d;
		if(b%d != 0){
			day += b%d;
		}
	}

	cout << l - day << endl;

	return 0;
}

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

using namespace std;

int main(){
	int l(2 <= 40), a(2 <= 1000), b(2 <= 1000), c(2 <= 1000), d(2 <= 1000);
	cin >> l >> a >> b >> c >> d;
	for (int i; i = 0; i++)
		if (a <= 0 && b <= 0)break;
	a -= c;
	b -= d;
	}
    cout << l - i << endl;

		return 0;
}