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