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<string>
#include<cmath>
#include<algorithm>
using namespace std; 
int main(){
  int L,A,B,C,D;
  cin>>L>>A>>B>>C>>D;
  int Jday,Mday;
  if(A%C==0){
    Jday=A/C;
  }
  else Jday=A/C+1;
  if(B%D==0){
    Mday=B/D;
  }
  else Mday=B/D+1;

  if(Jday>Mday){
    cout<<L-Jday<<endl;
  }
  else {
    cout<<L-Mday<<endl;
  }

return 0;
}

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

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)
#define vvl(v,w,h,init) vector<vector<ll>> v(w,vector<ll>(h,init));

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;
using pll = pair<ll,ll> ;

const int mod = 1000000007;
constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0,1,-1,1,-1};
const int dx[] = {0,-1,0,1,1,-1,-1,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll a,b,c,d,l;
  cin >> l >> a >> b >> c >> d;
  if(a%c == 0) --a;
  if(b%d == 0) --b;
  l -= max(a/c,b/d)+1;
  cout << l << 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;
  cout << L - max(A%C?A/C+1:A/C,B%D?B/D+1:B/D) << endl;
}

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

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

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

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

  cout << l << endl;

  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    int L, A, B, C, D;
    cin >> L >> A >> B >> C >> D;
    int t = max((A + C - 1) / C, (B + D - 1) / D);
    cout << L - t << "\n";
    return 0;
}

C++: #include<iostream>
#include<cstdio>
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[0] << endl;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <vector>

using namespace std;

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

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

int main(){
  int l,a,b,c,d,A,B;
  cin>>l>>a>>b>>c>>d;
  A=a/c;
  B=b/d;
  if(a%c)A++;
  if(b%d)B++;
  cout<<min(l-A,l-B)<<endl;
  return 0;
}

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<stdio.h>
int main(void)
{
	int L,A,B,C,D;
	int a,b,c;
	scanf("%d",&L);
	scanf("%d",&A);
	scanf("%d",&B);
	scanf("%d",&C);
	scanf("%d",&D);
	a=A/C;
	if(A%C!=0){
		a=A/C;
		a=a+1;
	}
	b=B/D;
	if(B%D!=0){
		b=B/D;
		b=b+1;
	}
	if(a>=b){
		c=L-a;
	}
	else if(a<b){
		c=L-b;
	}
	printf("%d\n",c);
	return 0;
}

C++: #include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#include<map>
#include<stack>
#include<queue>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int solve(int b, int c){
    int d1;
    if(b % c == 0){
        d1 = b / c;
    }else{
        d1 = b / c + 1;
    }
    return d1;
}

int main(){
    int a,b,c,d,e;
    while(cin >> a >> b >> c >> d >> e){
        int d1, d2;
        d1 = solve(b, d);
        d2 = solve(c, e);
        cout << a - max(d1, d2) << endl;
    }
}

C++: #include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <sstream>
#include <cstring>
#include <cstdlib>

using namespace std;

#define ALL(c) c.begin(),c.end()
#define RALL(c) c.rbegin(),c.rend()
#define SORT(x) sort((x).begin(),(x).end())
#define REP(i,x,y) for(int i=(x);i<(y);++i)
#define MP(a,b) make_pair((a),(b))
#define F_ first
#define S_ second

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

const int INF=1<<30;
const long long int INF_=1<<60;
const int dx[]={1,0,-1,0},dy[]={0,1,0,-1};

int ans,X,Y;
map<pair<int,vector<vector<char> > >,bool> done;

void Fill(vector<vector<char> > &cell,char color){
	vector<vector<bool> > is_done(Y,vector<bool>(X,false));
	queue<P> que;
	//cell[0][0]=color;
	//is_done[0][0]=true;
	que.push(MP(0,0));
	char prev_color=cell[0][0];
	while(!que.empty()){
		P p=que.front();
		que.pop();
		cell[p.F_][p.S_]=color;
		is_done[p.F_][p.S_]=true;
		REP(i,0,4){
			int ny=p.F_+dy[i],nx=p.S_+dx[i];
			if(!(0<=ny&&ny<Y&&0<=nx&&nx<X&&prev_color==cell[ny][nx]&&!is_done[ny][nx])) continue;
			que.push(MP(ny,nx));
		}
	}
}

bool Check(const vector<vector<char> > &cell){
	char color=cell[0][0];
	bool flag=true;
	REP(y,0,Y) REP(x,0,X){
		if(cell[y][x]!=color){
			flag=false;
			break;
		}
	}
	return flag;
}

void DFS(const vector<vector<char> > &cell,int cnt){
	//cout << cnt << endl;
	if(done[MP(cnt,cell)]) return;
	if(ans<cnt) return;
	if(Check(cell)){
		ans=cnt;
		return;
	}
	/*
	cout << cnt << endl;
	REP(y,0,Y){
		REP(x,0,X) cout << cell[y][x] << ' ';
		cout << endl;
	}
	cout << endl;
	*/
	vector<vector<char> > cell_;
	if(cell[0][0]!='R'){
		cell_=cell;
		Fill(cell_,'R');
		DFS(cell_,cnt+1);
	}
	if(cell[0][0]!='G'){
		cell_=cell;
		Fill(cell_,'G');
		DFS(cell_,cnt+1);
	}
	if(cell[0][0]!='B'){
		cell_=cell;
		Fill(cell_,'B');
		DFS(cell_,cnt+1);
	}
	done[MP(cnt,cell)]=true;
}

int main(){
	std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    while(cin >> X >> Y&&X&&Y){
		done.clear();
		ans=16;
		vector<vector<char> > cell(Y,vector<char>(X));
		REP(y,0,Y) REP(x,0,X) cin >> cell[y][x];
		DFS(cell,0);
		cout << ans << endl;
	}
	return 0;
}

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

int day(int x, int y) {
    return (x + y - 1) / y;
}

int L, A, B, C, D;
int main() {
    cin >> L >> A >> B >> C >> D;
    cout << L - max(day(A, C), day(B, D)) << endl;
    return 0;
}