#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, days, offset, tmp;
  cin >> n >> m;
  if (m > n) {
    cout << n << endl;
    return 0;
  }
  n -= m;
  long long start = 0, middle, ending = 2e9;
  while (start <= ending) {
    middle = (start + ending) / 2;
    tmp = (middle * (middle + 1)) / 2;
    if (tmp >= n) {
      days = middle;
      ending = middle - 1;
    } else {
      start = middle + 1;
    }
  }
  cout << days + m << endl;
  return 0;
}
