#include <bits/stdc++.h>
long long n, m;
long long check(long long d) { return -d * 0.5 * (d + 1) + n - m <= 0; }
int main() {
  long long l, r, mid, ans;
  while (scanf("%lld %lld", &n, &m) != EOF) {
    if (n < m) {
      printf("%lld\n", n);
    } else {
      l = 0;
      r = 1e18;
      while (l <= r) {
        mid = (r + l) / 2;
        if (check(mid)) {
          r = mid - 1;
          ans = mid;
        } else {
          l = mid + 1;
        }
      }
      printf("%lld\n", ans + m);
    }
  }
  return 0;
}
