#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;}
    }

}
