#include <bits/stdc++.h>
using namespace std;
long long findi(long long n) {
  long double x = (long double)(1 + (8 * n));
  x = sqrt(x);
  x = (x - 1) / 2;
  long long i = floor(x);
  long long sum = i * (i + 1) / 2;
  while (sum < n) {
    i++;
    sum += i;
  }
  return i;
}
int main() {
  long long n, m;
  cin >> n >> m;
  if (n <= m) {
    cout << n << endl;
  } else {
    cout << m + findi(n - m) << endl;
  }
  return 0;
}
