#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x;
  cin >> n >> x;
  int day = n;
  int i = 1;
  int m;
  m = x * i;
  while (day >= m) {
    ++day;
    ++i;
    m = x * i;
  }
  cout << day << endl;
  return 0;
}
