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