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