#include <bits/stdc++.h>
using namespace std;
long long n, m;
bool pos(long long xx) {
  long long v = (xx * (xx - 1)) / 2 + (xx + m);
  return v >= n;
}
int main() {
  cin >> n >> m;
  if (n <= m) {
    cout << n << "\n";
  } else {
    long long st = 0, en = 10000000009, mid;
    while (st < en) {
      mid = (st + en) / 2;
      if (pos(mid)) {
        en = mid - 1;
      } else
        st = mid + 1;
    }
    while (!pos(en)) en++;
    cout << m + en << "\n";
  }
}
