#include <iostream>
#include <algorithm>
using namespace std;
typedef long long lli;

int main() {
  lli M, rd, rr, cd, cr;
  cin >> M >> rd >> rr >> cd >> cr;
  lli xd = cd*100/rd;
  while(xd*rd/100 < cd) ++xd;
  if(xd > M) {
    cout << -1 << endl;
    return 0;
  }
  M -= xd;
  lli remd = xd*rd/100 - cd;

  lli xr = cr*100/rr;
  while(xr*rr/100 < cr) ++xr;
  if(xr > M) {
    cout << -1 << endl;
    return 0;
  }
  M -= xr;
  lli remr = xr*rr/100 - cr;

  M += remd * 100 / rd;
  M += remr * 100 / rr;

  cout << M << endl;
  return 0;
}