#include <bits/stdc++.h>
using namespace std;
#define MP make_pair
#define PB push_back
#define FOR(init,num,inc) for(int i=init; i<num;i=i+inc)
#define N "\n"
#define VII vector<int> :: iterator
#define VILLI vector<long long int> :: iterator
#define my_input(n) for(int i=0,a;i<n;i++) {cin>>a; v.PB(a);}
#define sz size()
#define fst first
#define snd second
#define FV 100005
#define SX 1000005
#define scint(a) scanf("%d", &a)
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
typedef int I;
typedef long long int llint;
typedef vector<int> VI;
typedef vector<long long int > VLLI;
typedef vector<string> VS;
typedef set<int> SI;
typedef set<long long int> SLLI;
typedef set<string> SS;
int main()
{
double p,q;
cin>>p>>q;
p*=100;
q*=100;
for(llint i=1; i<=300000000; i++ )
{
double x=((double)i*p);
double y=((double)i*q);
if(x/10000<(llint)(y/10000) && (llint)(y/10000)<y/10000) {cout<<i; return 0;}
}
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgojZGVmaW5lIE1QIG1ha2VfcGFpcgojZGVmaW5lIFBCIHB1c2hfYmFjawojZGVmaW5lIEZPUihpbml0LG51bSxpbmMpIGZvcihpbnQgaT1pbml0OyBpPG51bTtpPWkraW5jKQojZGVmaW5lIE4gIlxuIgojZGVmaW5lIFZJSSB2ZWN0b3I8aW50PiA6OiBpdGVyYXRvcgojZGVmaW5lIFZJTExJICAgdmVjdG9yPGxvbmcgbG9uZyBpbnQ+IDo6IGl0ZXJhdG9yCiNkZWZpbmUgbXlfaW5wdXQobikgZm9yKGludCBpPTAsYTtpPG47aSsrKSB7Y2luPj5hOyB2LlBCKGEpO30KI2RlZmluZSBzeiBzaXplKCkKI2RlZmluZSBmc3QgZmlyc3QKI2RlZmluZSBzbmQgc2Vjb25kCiNkZWZpbmUgRlYgMTAwMDA1CiNkZWZpbmUgU1ggMTAwMDAwNQojZGVmaW5lIHNjaW50KGEpIHNjYW5mKCIlZCIsICZhKQovL2ZyZW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