#include <cstdio>
#include <algorithm>

using namespace std;

typedef long long lint;

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