#include <bits/stdc++.h>

using namespace std;

int main(){

	int n,a,b,c,d;
	cin>> n >> a >> b >> c >> d;
	int na = a / c;
	if(a % c != 0)na++;
	int nb = b / d;
	if(b % d != 0)nb++;
	cout << n-max(na,nb) << endl;
	return 0;
}
