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