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<algorithm>
using namespace std;
int main(){
	int l,a,b,c,d;
	scanf("%d%d%d%d%d",&l,&a,&b,&c,&d);
	
	int x=0,y=0;
	
	x = (a%c == 0) ? a/c : a/c+1;
	y = (b%d == 0) ? b/d : b/d+1;
	
	//printf("%d %d\n",x,y);
	
	int z;
	z = max(x,y);
	
	printf("%d\n",l - z);

	return 0;
}

C++: #include <iostream>

using namespace std;


int main(){

  int a,b,c,d,l,sum=0,e,f;

 cin >> l >> a >> b >> c >> d ;
 
while(1){

  if(a<c){
    f=1;
  }

  if(f==1){
    break;
  }
 c+=c;

 sum++;
 }

while(1){

  if(b<d){
    e=1;
  }

  if(e==1){
    break;
  }
 d+=d;

 sum++;
 }

 cout << l-sum;


 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 << endl;


  return 0;
}

C++: #include<iostream>
int main() {
	int last, last2;
	int day;
	int a, b;
	int max1, max2;
	std::cin >> day >> max1>> max2 >> a>> b;
	if (max1%a > 0)last = (max1 / a) +1;
	else last = max1 / a;
	if (max2%b > 0)last2 = (max2 / b) + 1;
	else last2 = max2 / b;
	if (last >= last2)std::cout << day - last<<std::endl;
	else std::cout << day - last2 << std::endl;
	return 0;
}

C++: #include<iostream>
using namespace std;
int L, A, B, C, D;
int rA = 0, rB = 0;
int main(){
cin >> L >> A >> B >> C >> D;
if( A - (A/C) * C > 0) { rA = 1;}
if( B - (B/D) * D > 0) { rB = 1;}
cout << L - max((A/C) + rA,(B/D) +rB ) << endl;
return0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int L,A,B,C,D,AC,BD;
    cin>>L>>A>>B>>C>>D;
    if(A%C==0)AC=L-(A/C);
    else AC=L-(A/C+1);
    if(B%D==0)BD=L-(B/D);
    else BD=L-(B/D+1);
    if(AC>BD)cout<<AC<<endl;
    else cout<<BD<<endl;
}

C++: #include<iostream>
using namespace std;
int main(){
  int days,sj,sm,j,m;
  cin >> days >> sj >> sm >> j >> m;
  while(1){
    if(sj<=0 && sm<=0)break;
    sj-=j;
    sm-=m;
    days--;
  }
  cout << days << endl;
  return 0;
}

C++: #include <bits/stdc++.h>
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;
  while (a > 0 || b > 0){
    l--;
    a -= c;
    b -= d;
  }
  cout << l << endl;
}

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

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

  int k = (a + c - 1) / c, s = (b + d - 1) / d;
  cout << l - max(k, s) << 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 l;
	int a;
	int b;
	int c;
	int d;
	cin >> l;
	cin >> a;
	cin >> b;
	cin >> c;
	cin >> d;
	int e = a / c;
	int f = b / d;
	int g;
	int h;
	if (e*c == a)
	{
		g = e;
	}
	else
	{
		g = e + 1;
	}
	if (f*d == b)
	{
		h = f;
	}
	else
	{
		h = f + 1;
	}
	if (g < f)
	{
		cout << l - f << endl;
	}
	else
	{
		cout << l - g << endl;
	}

	
	return 0;
}

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

int main()
{
	//??????(homework)
	int num1=0,num2=0,num3=0,num4=0,num5=0,num6=0,num7=0,num8=0,num9=0,num10=0,t=0;
	cin>>num1>>num2>>num3>>num4>>num5;
	num6=num2/num4;
	num9=num2%num4;
	if(num9!=0){
		num6=num6+1;
	}
	num7=num3/num5;
	num10=num3%num5;
	if(num10!=0){
		num7=num7+1;
	}
	if(num6<num7){
		t=num6;
		num6=num10;
		num10=t;
	}
	num8=num1-num6;
	cout<<num8;
	cout<<"\n";
	return 0;
}

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

int main()
{
 int l,a,b,c,d,x,y;
 cin >>l>>a>>b>>c>>d;
 if(a%c>0){
     x=a/c+1;}
 else{
      x=a/c;}
 if(b%d>0){
     y=b/d+1;}
 else{
      y=b/d;}
 if(x>y)
    cout<<l-x;
 else
    cout<<l-y;
 return 0;
}

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, 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++: #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<iostream>
using namespace std;

int main(){
  int l,a,b,c,d;
  cin >>l>>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)+1)<<endl;
  }
  else if(b%d==0){
    cout <<l-max((a/c)+1,b/d)<<endl;
  }
  else{
    cout <<l-max((a/c)+1,(b/d)+1)<<endl;
  }
    return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <cmath>
#include <complex>
#include <map>
#include <climits>
#include <sstream>
using namespace std;

#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-8
#define F first
#define S second
#define mkp make_pair

static const double PI=6*asin(0.5);
typedef long long ll;
typedef complex<double> CP;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vint;
static const int INF=1<<24;

template <class T>
void initvv(vector<vector<T> > &v,int a,int b, const T  &t = T()){
	v.assign(a,vector<T>(b,t));
}

//v.erase(unique(v.begin(),v.end()),v.end());

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

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<set>
using namespace std;
int main()
{
	int a, b, c, d, e, i, j, k, l, m, n, o, p, q, r;
	cin >> a;
	cin >> b;
	cin >> c;
	cin >> d;
	cin >> e;
	j = b%d;
	if (j>0)
	{
		b = b / d;
		b = b + 1;
	}
	else if (j == 0)
	{
		b = b / d;
	}
	i = c%e;
	if (i>0)
	{
		c = c / e;
		c = c + 1;
	}
	else if (i == 0)
	{
		c = c / e;
	}
	a=a-max(b, c);
	cout <<a<< endl;
	return 0;
}

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

int main(){

  int l,a,b,c,d;
  int x = 0,y = 0;

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

  while(a >= c){
    a -= c;
    x++;
  }

  while(b >= d){
    b -= d;
    y++;
  }

  if(a != 0) x++;
  if(b != 0) y++;

  cout << l - max(x,y) << endl;

}

C++: a,b,c,d,e,*p=&a;main(){while(~scanf("%d",p++));printf("%.f\n",a-fmax(--b/d,--c/e)-1);}