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 <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;

#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define range(i,a,n) for(int i=(a);i<(n);i++)

#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI 3.1415926535897932384

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};

template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S acm(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
void YN(bool b){cout<<(b?"YES":"NO")<<"\n";}
void Yn(bool b){cout<<(b?"Yes":"No")<<"\n";}
void yn(bool b){cout<<(b?"yes":"no")<<"\n";}

ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s;a=0;} return os;}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int a,b,c,d,e;
	cin>>a>>b>>c>>d>>e;
	cout<<a-max(((b+d-1)/d),((c+e-1)/e))<<endl;
}

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

int main() {
	int a, b, c, d, e, q, w;
	cin >> a >> b >> c >> d >> e;
	q = b / d;
	if (b%d == 1) q += 1;
	w = c / e;
	if (c%e == 1) w += 1;
	cout << a - max({ q,w }) << endl;
}

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

using namespace std;

int main() {
	
	int day;
	int nihongo[3], math[3];

	while (cin >> day) {

		cin >> nihongo[0] >> math[0] >> nihongo[1] >> math[1];
		
		if (nihongo[0] % nihongo[1])
			nihongo[2] = nihongo[0] / nihongo[1] + 1;

		else
			nihongo[2] = nihongo[0] / nihongo[1];

		if (math[0] % math[1])
			math[2] = math[0] / math[1] + 1;

		else
			math[2] = math[0] / math[1];

		cout << day - max(nihongo[2], math[2]) << "\n";

	}

	return 0;

}

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

typedef long long ll;

using namespace std;


int main(){
    int l,a,b,c,d;
    
    scanf("%d%d%d%d%d",&l,&a,&b,&c,&d);
    
    printf("%d\n",l-(int)max(ceil((double)a/c),ceil((double)b/d)));
    
    return 0;
}

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

C++: #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<long long> vll;
typedef pair<int,int> pint;
typedef pair<long long, long long> pll;

#define MP make_pair
#define PB push_back
#define ALL(s) (s).begin(),(s).end()
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

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; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P) 
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P) 
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P) 
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s; }


int L, A, B, C, D;


int main() {
    while (cin >> L >> A >> B >> C >> D) {
        int d = max( (A+C-1)/C, (B+D-1)/D );
        cout << L - d << endl;
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int A,B,C,D,L;
  int J,M;
  int enjoy;
  cin >> L >> A >> B >> C >> D ;
  if(A%C==0){
    J=A/C;
  }else{
    J=A/C+1;
  }
  if(B%D==0){
    M=B/D;
  }else{
    M=B/D+1;
  }
  if(J<M){
    enjoy=L-M;
  }else{
    enjoy=L-J;
  }
  
  cout << enjoy << endl;
  
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
	cin.tie(0); ios::sync_with_stdio(false);
	int A, B, C, D, L; cin >> L >> A >> B >> C >> D;
	int kokugo = A / C, sugaku = B / D;
	if (A%C != 0)kokugo++;
	if (B%D != 0)sugaku++;
	cout << L - max(kokugo,sugaku) << endl;
}

C++: #include<iostream>

using namespace std;

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

  int tmp1 = A/C;
  int tmp2 = B/D;

  if(A%C) tmp1++;
  if(B%D) tmp2++;
  
  cout << L-max(tmp1,tmp2) << endl;

  return 0;
}

C++: #include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctype.h>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>

using namespace std;

//4方向ベクトル→↑←↓
int dx[] ={1,0,-1,0};
int dy[] ={0,-1,0,1};
double L,A,B,C,D;
int main()
{
  cin >>L>>A>>B>>C>>D;
  if(A/C>B/D)
    cout <<L-ceil(A/C)<<endl;
  else
    cout<<L-ceil(B/D)<<endl;
  return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int p,a,b,c,d,x,y;
	cin>>p;
	cin>>a;
	cin>>b;
	cin>>c;
	cin>>d;
	x=a/c;
	if(a%c)
	x++;
	y=b/d;
	if(b%d)
	y++;
	cout<<p-max(x,y)<<endl;
return 0;
}

C++: #include<bits/stdc++.h>
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;
}