#include <bits/stdc++.h>
using namespace std;
int main(int, char**) {
  long long n, m, k;
  cin >> n >> m;
  if (n <= m)
    cout << n;
  else {
    n = n - m;
    k = (sqrt(1 + 8 * n) - 1) / 2;
    n = 2 * n;
    while (k * (k + 1) < n) k++;
    cout << (m + k);
  }
  return 0;
}
