#include <iostream>
#include<algorithm>
using namespace std;

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

