#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
long long POWER[65];
long long power(long long a, long long b) {
  long long ret = 1;
  while (b) {
    if (b & 1) ret *= a;
    a *= a;
    if (ret >= MOD) ret %= MOD;
    if (a >= MOD) a %= MOD;
    b >>= 1;
  }
  return ret;
}
long long inv(long long x) { return power(x, MOD - 2); }
void precompute() {
  POWER[0] = 1;
  for (int i = 1; i < 63; i++) POWER[i] = POWER[i - 1] << 1LL;
}
const int MAXN = 205;
int ar[MAXN];
int main() {
  precompute();
  long long n, x;
  cin >> n >> x;
  long long div = n / x;
  cout << x + n * x << endl;
  return 0;
}
