#include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int l,a,b,c,d;
  cin>>l>>a>>b>>c>>d;
  int x,y;
  x=a/c;
  if(a%c!=0){
    x++;
  }
  y=b/d;
  if(b%d!=0){
    y++;
  }
  cout<<l-max(x,y)<<endl;
}