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 l; // ??¬???????????\??°
	int a, b, c, d;
	int koku, san;
	std::cin  >> l >> a >> b >> c >> d;
	koku = b / d;
	san = a / c;
	if (b%d != 0) {
		koku++;
	}
	if (a%c != 0) {
		san++;
	}

	l = l - std::max(koku, san);
	
	std::cout << l << std::endl;

	return 0;
}

C++: #include <iostream>
using namespace std;
int main()
{
	int L,A,B,C,D; int dayA,dayB,ans;
	cin >> L >> A >> B >> C >> D ;
	if(A%C==0) dayA=A/C; else dayA=A/C+1;
	if(B%D==0) dayB=B/D; else dayB=B/D+1;
	ans=L-max(dayA,dayB);
	cout << ans << '\n' ;
}

C++: #include <algorithm>
#include <iostream>
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;
}

C++: #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define CLR(mat) memset(mat, 0, sizeof(mat))
typedef long long ll;

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;
  return 0;
}

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

int main() {
  int A, B, C, D, L;
  int X, Y;

  cin >> L >> A >> B >> C >> D;

  X = A/C;
  if(A%C != 0)
    X++;
  Y = B/D;
  if(B%D != 0)
    Y++;

  cout << (X>Y) ? L-X :	L-Y << endl;
}

C++: #include <iostream>
#include <algorithm>
#include <array>
#include <functional>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string>
#include <vector>

#define INF 1000000000
#define MOD 1000000007
#define ll long long
#define rep(i,a,b) for(int i = (a); i < (b); i++)
#define bitget(a,b) (((a) >> (b)) & 1)
#define vint vector<int>
#define vvint vector<vector<int>>
#define vsort(x) sort(x.begin(),x.end())

using int64 = uint64_t;

using namespace std;

int main() {
	int l, a, b, c, d;
	cin >> l >> a >> b >> c >> d;
	cout << l - max(a / c + 1, b / d + 1) << endl;
	return 0;
}

C++: #include <cstdio>
int a,b,c,d,e;
int main(void){
  scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
  printf("%d\n",a-(((b+d-1)/d>(c+e-1)/e)?(b+d-1)/d:(c+e-1)/e));
  return 0;
}

C++: #include  <iostream>

using namespace std;

int dr(int argDr, int argJoi)
{
	if (!(argDr % argJoi)) { return argDr / argJoi; }
	return (argDr / argJoi) + 1;
}

int main()
{
	int day, dr1, dr2, joi1, joi2;
	
	cin >> day;
	cin >> dr1;
	cin >> dr2;
	cin >> joi1;
	cin >> joi2;
	
	joi1 =	dr(dr1, joi1);
	joi2 =	dr(dr2, joi2);
		
	cout << day - (joi1 > joi2 ? joi1 : joi2) << endl;
}

C++: #include <cassert>

#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
//#include <boost/foreach.hpp>
//#include <boost/range/algorithm.hpp>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define ll long long
#define Sort(v) sort(all(v))
#define INF 1000000000
#define END return 0
#define pb push_back
#define se second
#define fi first
#define pb push_back
#define all(v) (v).begin() , (v).end()
#define MP make_pair
#define MOD 1000000007LL
using namespace std;
int day[12]={31,28,31,30,31,30,31,31,30,31,30,31};

int main (){
    int l,a,b,c,d;
    cin>>l>>a>>b>>c>>d;
    cout<<max(0,l-max((a+c-1)/c,(b+d-1)/d))<<endl;
}


/*
abcdea

/root
a.txt
bunp.html
/desktop
r.txt
fsharp.cs
dp.cpp
/users
bison.txt

root r.txt
users r.txt
users a.txt

desktop/r.txt
../r.txt
../../a.txt
*/

C++: #include <iostream>
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 : 0), B / D + (B % D ? 1 : 0)) <<endl;
  return 0;
}

C++: #include <iostream>

using namespace std;

#define MAX(a,b) ((a)>(b)?(a):(b))

int main()
{
    int L,A,B,C,D;
    cin >> L >> A >> B >> C >> D;
    int maxA,maxB;
    maxA=A/C;
    if(A%C!=0) ++maxA;
    maxB=B/D;
    if(B%D!=0) ++maxB;
    cout << L-(MAX(maxA,maxB)) << endl;
    return 0;
}

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

int main(){
    int day,a,b,c,d;
    cin >>day>>a>>b>>c>>d;
    if(a%c!=0){
        a=1+(a/c);
    }
    else a/=c;
    if(b%d!=0){
        b=1+(b/d);
    }
    else b/=d;
    if(a>b)day-=a;
    else day-=b;
    cout <<day<<endl;

    return 0;
}

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

using namespace std;

int rec(int n, int m) {

  if (n <= 0)
    return 0;
  else
    return 1 + rec(n-m, m);
}

int main(void) {

  int L, A, B, C, D;
  cin >> L >> A >> B >> C >> D;
  
  int s, t, u;
  s = rec(A, C);
  t = rec(B, D);
  
  u = max(s, t);
  cout << L - u << 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 - 1) / c, (b - 1) / d) - 1 << endl;

	return 0;
}

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

C++: #include<iostream>
using namespace std;
 
int main()
{
int L,A,B,C,D,K,E,F,G,H;
cin>>L>>A>>B>>C>>D;
E=A/C;
F=B/D;
G=A%C;
H=B%D;
if(G>0){
E+=1;
}
if(H>0){
F+=1;
}
if(E<F){
K=L-E;
}
if(E>F){
K=L-F;
}
if(E=F){
K=L-E;
}
cout<<K<<'\n';
return 0;
}

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

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

    int free = l;
    const int lang = ceil((float)a / c);
    const int math = ceil((float)b / d);
    free -= max(lang, math);

    cout << free << endl;
}

C++: #include<stdio.h>
int main(){
	int A, B, C, D, L, x, y;
	scanf("%d %d %d %d %d", &L, &A, &B, &C, &D);
	x = A / C;
	if(( A % C) != 0){
		x++;
	}
	y = B / D;
	if(( B % D) != 0){
		y++;
	}
	if( x > y){
		L= L - x;
	}else{
		L= L- y;
	}
	printf("%d\n",L);
	return 0;
}