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

typedef long double ld;

int main(){
  ld M, rD, rR, cD, cR;
  cin >> M >> rD >> rR >> cD >> cR;
  ld j1, j2;
  
  j1 = ceil( (100*cD) / rD);
  j2 = ceil( (100*cR) / rR);
  
  long long ans = M - j1 - j2;
  cout << ((ans >= 0) ? ans : -1) << endl;  
  return 0;
}