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