#include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long int ll; const int INF = 1000000000; #define rep(i,n) for(int i=0;i<(int)(n);i++) int a, b; int x, y; bool aaa(){ double e = (double) x; double f = (double) y; double k = 100 * e/(e + f); double c = (double) a; if(c - 0.5 <= k && k < c + 0.5) return true; return false; } bool bbb(){ double e = (double) x; double f = (double) y; double k = 100 * f/(e + f); double c = (double) b; if(c - 0.5 <= k && k < c + 0.5) return true; return false; } int main(){ cin >> a >> b; if(a > b) swap(a, b); x = a, y = b; int ans = INF; if(a==b){ puts("2"); return 0; } for(int i = 1; i <= a; i++){ x = i; y = (b / a) * i; y += 10; while(1){ y--; if(y == x) break; if(aaa() && bbb()) break; } if(aaa() && bbb()){ while(1){ y--; if(!(aaa() && bbb())){ y++; break; } } ans = min(x + y, ans); } } if(ans == INF) ans = a + b; cout << ans << endl; return 0; }