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