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