#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e9 + 7;
long long n, m;
int main() {
  cin >> n >> m;
  if (n <= m) {
    cout << n << endl;
    return 0;
  }
  long long l = 0, r = MAXN, mid;
  while (l < r) {
    mid = (l + r) >> 1;
    if (mid * (mid + 1) / 2 >= n - m)
      r = mid;
    else
      l = mid + 1;
  }
  cout << l + m << endl;
  return 0;
}
