#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long n, m, count, sum;
  double r;
  cin >> n >> m;
  if (n <= m) {
    cout << n;
  } else {
    r = 2 * (n - m);
    r = sqrt(r);
    count = (long long)r;
    if ((count + 1) * count < 2 * (n - m)) count++;
    cout << m + count;
  }
  return 0;
}
