#include #include #include #include #include #include #include #include #include #include #include #include #define vll vector #define vvvl vector #define vvl vector> #define VV(a, b, c, d) vector>(a, vector(b, c)) #define VVV(a, b, c, d) vector(a, vvl(b, vll (c, d))); #define re(c, b) for(ll c=0;c> a >> b; if(gcd(a, b)!=1){ std::cout << -1 << '\n'; return 0; } ll l = lcm(a, b); vll ok(lcm(a, b)+1, 1); for(int x=0;x<=100;x++){ for(int y=0;y<=100;y++){ ll num = x*a+y*b; if(num>l) continue; ok[num] = 0; } } ll ans = 0; for(int i=1;i<=l;i++) ans += ok[i]; std::cout << ans << '\n'; return 0; }