#include <bits/stdc++.h>
using namespace std;
long long bsearch(long long key) {
  long long lo = 0;
  long long hi = 10000000000;
  while (lo < hi) {
    long long mid = lo + (hi - lo) / 2;
    long long x = (mid * (mid + 1)) / 2;
    if (x == key)
      return mid;
    else if (x > key)
      hi = mid;
    else
      lo = mid + 1;
  }
  return lo;
}
int main() {
  ios_base::sync_with_stdio(false);
  long long t, i, j, n, k, m, ans = 0;
  cin >> n >> m;
  if (m >= n) {
    cout << n << endl;
    return 0;
  }
  ans = m;
  long long x = bsearch(n - m);
  ans = ans + x;
  cout << ans << endl;
  return 0;
}
