#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  long long n, m, cnt = 0;
  cin >> n >> m;
  if (n < m) {
    cout << n << endl;
    return 0;
  }
  cnt = m;
  long long tmp = (n - m) * 2, i;
  i = sqrt(tmp);
  while (i * (i + 1) < tmp) {
    i++;
  }
  cout << cnt + i << endl;
  return 0;
}
