#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll n, m;
  scanf("%lld%lld", &n, &m);
  if (n <= m) {
    printf("%lld\n", n);
  } else {
    ll rem = n - m;
    ll lo = 1;
    ll hi = 2000000000;
    ll mid = lo + (hi - lo) / 2;
    while ((hi - lo) > 1) {
      if ((mid * (mid + 1)) < (2 * rem)) {
        lo = mid + 1;
      } else {
        hi = mid;
      }
      mid = lo + (hi - lo) / 2;
    }
    if ((lo * (lo + 1)) >= (2 * rem)) hi = lo;
    printf("%lld\n", m + hi);
  }
  return 0;
}
