#include<iostream>
using namespace std;
int main(){
  int days,sj,sm,j,m;
  cin >> days >> sj >> sm >> j >> m;
  while(1){
    if(sj<=0 && sm<=0)break;
    sj-=j;
    sm-=m;
    days--;
  }
  cout << days << endl;
  return 0;
}