#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int grain, m, n;
  cin >> grain >> m;
  n = grain;
  if (m >= n)
    cout << n;
  else {
    cout << (long long int)(m + ceil((-1 + sqrtl(1 + 8 * (n - m))) / 2));
  }
  return 0;
}
