#include <bits/stdc++.h>
using namespace std;
long long int func(long long int d) { return (d * (d + 1)) / 2; }
int main() {
  long long int n, m, d;
  long long int left, right, mid;
  cin >> n >> m;
  left = 0;
  right = 2e9 + 1;
  if (n <= m) {
    cout << n;
    return 0;
  }
  mid = (left + right) / 2;
  while (left != mid) {
    if (func(mid) > n - m)
      right = mid;
    else if (func(mid) < n - m)
      left = mid;
    else
      break;
    mid = (left + right) / 2;
  }
  if (func(mid) >= n - m)
    cout << m + mid;
  else
    cout << mid + m + 1;
}
