#include <bits/stdc++.h>
using namespace std;
long long n, m, a;
long long verif(long long k) {
  if (k * (k + 1) / 2 >= n - m) {
    return 1;
  }
  return 0;
}
int main() {
  cin >> n >> m;
  if (m >= n) m = n - 1;
  long long lo = 1, hi = 1414213565, mid;
  while (lo <= hi) {
    mid = (lo + hi) / 2;
    int ok1 = verif(mid);
    int ok2 = verif(mid - 1);
    if (ok1 == 1 && ok2 == 0) {
      cout << mid + m << '\n';
      return 0;
    } else if (ok1 == 1) {
      hi = mid - 1;
    } else if (ok2 == 0) {
      lo = mid + 1;
    }
  }
  return 0;
}
