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<cstdio>
#include<algorithm>
using namespace std;

int main(){
  int l;
  int a,b;
  int c,d;
  int ans;
  int j,m;
  
  scanf(" %d %d %d %d %d",&l,&a,&b,&c,&d);
  
  j = m = 0;
  if(a%c!=0){
    j=1;
  }
  if(b%d!=0){
    m=1;
  }
  
  ans = max(a/c+j,b/d+m);
  
  printf("%d\n",l-ans);
  
  return 0;
}

C++: #include "bits/stdc++.h"

using namespace std;

const char en = '\n';
using  ll =          long long;
using ull = unsigned long long;
#define REP(i  ,n) for(int i=0;i<n;i++)
#define FOR(i,s,g) for(int i=s;i<g;i++)
const ll INFL = 810810191911451400;
const int INF =       1919114514;

int main(){
	ios::sync_with_stdio(false);cin.tie();

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

	cout<<l-max((a+(c-1))/c,(b+(d-1))/d)<<en;
	return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int L,A,B,C,D,cnt1=0,cnt2=0;
	cin>>L>>A>>B>>C>>D;
	while(A>0){
		A-=C;
		cnt1++;
	}
	while(B>0){
		B-=D;
		cnt2++;
	}
	cout<<min(L-cnt1,L-cnt2)<<endl;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
using namespace std;
int main()
{
	int a;
	int b;
	int c;
	int d;
	int e;
	int f;
	int g;
	cin >> a;
	cin >> b;
	cin >> c;
	cin >> d;
	cin >> e;
	f = b / d + 1;
	g = c / e + 1;
	if (f > g)
	{
		cout << a - f << endl;
	}
	else
	{
		cout << a - g << endl;
	}
	return 0;
}

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

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

C++: // JOI1.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
//
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <math.h>

int main()
{
	int day;
	double japan_day, math_day, japan_max, math_max;

	scanf("%d", &day);
	scanf("%lf", &japan_day);
	scanf("%lf", &math_day);
	scanf("%lf", &japan_max);
	scanf("%lf", &math_max);

	int a = ceil(japan_day / japan_max);
	int b = ceil(math_day / math_max);

	int max;
	if (a > b) {
		max = a;
	}
	else {
		max = b;
	}

	printf("%d\n", day - max);

	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(void)
{
	int L,A,B,C,D;
	scanf("%d %d %d %d %d",&L,&A,&B,&C,&D);
	if(A%C==0)
	{
		A/=C;
	}
	else
	{
		A=A/C+1;
	}
	if(B%D==0)
	{
		B/=D;
	}
	else
	{
		B=B/D+1;
	}
	C=max(A,B);
	printf("%d\n",L-C);
	return 0;
}
//13:25.249cliar!!

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

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

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

  a = (a + c - 1) / c;
  b = (b + d - 1) / d;

  if (a > b){
    cout << l - a << endl;
    return 0;
  }
  cout << l - b << endl;

  return 0;
}

C++: #include<stdio.h>
int main(){
	int a,b,c,d,e,f;
	scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
	f=b%d;
	b-=f;
	b/=d;
	if(f!=0)b++;
	f=c%e;
	c-=f;
	c/=e;
	if(f!=0)c++;
	if(b>c){
		printf("%d\n",a-b);
	}
	else{
		printf("%d\n",a-c);
	}
}

C++: #include <stdio.h>
#include<math.h>

int main(){
	int L,A,B,C,D,X,Y,N,Z;
	scanf("%d",&L);
	scanf("%d",&A);
	scanf("%d",&B);
	scanf("%d",&C);
	scanf("%d",&D);
	X = A/C;
	if(A%C > 0){
		X ++;
	}
	Y = B/D;
	if(B%D > 0){
		Y ++;
	}
	N = fmax(X,Y);
	Z = L - N;
	printf("%d\n",Z);
	return 0;
}

C++: #include<stdio.h>
int main()
{
	int a[101], temp = 0, ruio = 0, ahotoy=0,b[101];
	for (int i = 1; i <= 5; i++) {
		scanf("%d", &a[i]);
	}
	for (int i = 1; i <= 5; i++) {
		b[i] = a[i];
	}
	while (a[2] > 0 && a[3] > 0) {
		if (a[2] > 0) {
			a[2] = a[2] - a[4];
			ruio++;
		}
		else {
			a[3] = a[3] - a[5];
			ruio++;
		}
	}
	printf("%d\n", a[1]-ruio);
	return 0;
}

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

int main()
{
	int a, b, c, d, l;
	int j, m;
	cin >> l >> a >> b >> c >> d;
	
	j = a/c;
	m = b/d;
	
	if(j < m) cout << l-m << endl;
	else cout << l-j << endl;
	
	return 0;
}

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