#include <bits/stdc++.h>
using namespace std;
long long n, m;
long long f(long long x) {
  long long l = -1;
  long long r = 2e9;
  while (r - l > 1) {
    long long mid = (r + l) / 2;
    if (mid * (mid + 1) >= 2 * x) {
      r = mid;
    } else {
      l = mid;
    }
  }
  return r;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  if (n < m)
    cout << n << endl;
  else {
    long long res = m;
    long long cur = n - m;
    res += f(cur);
    cout << res << endl;
  }
  return 0;
}
