#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using namespace std;
const int inf = (int)1e9;
const int mod = inf + 7;
const double eps = 1e-9;
const double pi = acos(-1.0);
int main() {
  long long n, m;
  cin >> n >> m;
  if (n <= m) {
    cout << n << endl;
    return 0;
  }
  n -= m;
  long long l = 0, r = 2 * inf;
  long long ans = l;
  while (l < r) {
    long long mid = (l + r) >> 1;
    long long val = mid * (mid + 1) / 2;
    if (val >= n) {
      r = mid;
    } else {
      l = mid + 1;
    }
  }
  cout << l + m << endl;
  return 0;
}
