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