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