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