#include<bits/stdc++.h>
using namespace std;
long long x, y;
long long ex;
bool check(int mid) {
long long res = (y + mid) * 100 / (x + mid);
if(ex != res) return true;
else return false;
}
long long solve() {
long long start = 0;
long long end = 1000000000;
long long mid;
if(!check(end)) return -1;
while(start + 1 < end) {
mid = (start + end) / 2;
if(check(mid)) end = mid;
else start = mid;
}
return end;
}
int main() {
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
cin >> x >> y;
ex = y * 100 / x;
cout << solve();
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KIAp1c2luZyBuYW1lc3BhY2Ugc3RkOwogCmxvbmcgbG9uZyB4LCB5Owpsb25nIGxvbmcgZXg7CmJvb2wgY2hlY2soaW50IG1pZCkgewogICAgbG9uZyBsb25nIHJlcyA9ICh5ICsgbWlkKSAqIDEwMCAvICh4ICsgbWlkKTsKICAgIAogICAgaWYoZXggIT0gcmVzKSByZXR1cm4gdHJ1ZTsKICAgIGVsc2UgcmV0dXJuIGZhbHNlOwp9CiAKbG9uZyBsb25nIHNvbHZlKCkgewogICAgbG9uZyBsb25nIHN0YXJ0ID0gMDsKICAgIGxvbmcgbG9uZyBlbmQgPSAxMDAwMDAwMDAwOwogICAgbG9uZyBsb25nIG1pZDsKICAgIAogICAgaWYoIWNoZWNrKGVuZCkpIHJldHVybiAtMTsKICAgIAogICAgd2hpbGUoc3RhcnQgKyAxIDwgZW5kKSB7CiAgICAgICAgbWlkID0gKHN0YXJ0ICsgZW5kKSAvIDI7CiAKICAgICAgICBpZihjaGVjayhtaWQpKSBlbmQgPSBtaWQ7CiAgICAgICAgZWxzZSBzdGFydCA9IG1pZDsKICAgIH0KICAgIAogICAgcmV0dXJuIGVuZDsKfQogCmludCBtYWluKCkgewogICAgaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbyhmYWxzZSk7IGNpbi50aWUoMCk7IGNvdXQudGllKDApOwogICAgCiAgICBjaW4gPj4geCA+PiB5OwogICAgZXggPSB5ICogMTAwIC8geDsKICAgIAogICAgY291dCA8PCBzb2x2ZSgpOwp9