#include #include #include #include #include #include #include #include #include #include #include using namespace std; using namespace atcoder; typedef long long ll; #define rep(i,n) for (int i = 0; i < int(n);i++) int main(){ ll a,b; cin >> a >> b; ll ans = 0; if (a == 0){ ans = b; } else{ ll x = b/a; ans = a*x + b; } cout << ans << endl; return 0; }