import std.stdio;
import std.c.stdio;
import std.range;
import std.array;
import std.functional;
import std.algorithm;
import std.conv;
import std.container;
import std.math;
import std.numeric;
import std.string;
import std.c.string;
import std.regex;
import std.typecons;
 
void main() {
    long M, Rd, Rr, Cd, Cr;
    scanf("%lld %lld %lld %lld %lld\n", &M, &Rd, &Rr, &Cd, &Cr);
    long x = (100 * Cd + (Rd - 1)) / Rd;
    long y = (100 * Cr + (Rr - 1)) / Rr;
    long Ans = M - (x + y);
    if (Ans < 0) Ans = -1;
    writeln(Ans);
}