#include <bits/stdc++.h>
using namespace std;
const long long LLINF = LLONG_MAX;
const int INF = INT_MAX;
const int MAXN = 2e5 + 10;
long long n, m;
int main() {
  scanf("%I64d%I64d", &n, &m);
  if (m >= n) {
    printf("%I64d\n", n);
    return 0;
  }
  long long l = 0ll, r = 1ll << 31;
  while (l < r) {
    long long mid = (l + r) >> 1;
    if (m + ((mid * (mid + 1)) >> 1) < n)
      l = mid + 1;
    else
      r = mid;
  }
  printf("%I64d\n", l + m);
  return 0;
}
