#include <bits/stdc++.h>
using namespace std;
long long n, m;
int main() {
  cin >> n >> m;
  if (m >= n) {
    cout << n << endl;
    return 0;
  }
  long long lo = m + 1;
  long long hi = n;
  long long ans = hi;
  while (lo <= hi) {
    long long mid = (lo + hi) / 2;
    long long i = mid - m;
    long long s;
    if (i % 2 == 0)
      s = (i / 2) * (i + 1);
    else
      s = ((i + 1) / 2) * i;
    s += m;
    if (i >= 1414213563 || s >= n) {
      hi = mid - 1;
      ans = mid;
    } else {
      lo = mid + 1;
    }
  }
  cout << ans << endl;
}
