#include <bits/stdc++.h>
using namespace std;
long long n, m;
long long cal(long long x) {
  if (x <= m) return n - x;
  x = x - m;
  return (n - m - ((x * (x + 1)) / 2));
}
bool ok(long long x) {
  if (x * (x + 1) >= 2 * n)
    return 1;
  else
    return 0;
}
int main() {
  cin >> n >> m;
  if (n <= m) {
    cout << n << endl;
    return 0;
  }
  n = n - m;
  long long l = 0, r = 2 * 1e9;
  long long mid;
  while (l < r) {
    mid = (l + r) / 2;
    if (ok(mid))
      r = mid;
    else
      l = mid + 1;
  }
  if (ok(mid - 1))
    cout << m + mid - 1 << endl;
  else if (ok(mid))
    cout << m + mid << endl;
  else if (ok(mid + 1))
    cout << m + mid + 1 << endl;
  return 0;
}
