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