#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int N = 1e5 + 5;
long long n, m;
bool ok(long long x) { return n - x * (x + 1) / 2 <= 0; }
int main() {
  scanf("%I64d%I64d", &n, &m);
  long long l = 0, r = 1LL * 2e9, ans = 0;
  if (n <= m) return 0 * printf("%I64d\n", n);
  n -= m;
  while (l <= r) {
    long long m = (l + r) >> 1;
    if (ok(m))
      r = m - 1, ans = m;
    else
      l = m + 1;
  }
  ans += m;
  printf("%I64d\n", ans);
  return 0;
}
