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