#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
long long judge(long long n) { return n * (n + 1) / 2; }
int main() {
  long long n, m;
  scanf("%lld%lld", &n, &m);
  if (m >= n) return 0 * printf("%lld\n", n);
  long long l = 1, r = 2e9, mid, ans = 1e10;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (n - judge(mid - 1) <= mid + m) {
      ans = min(ans, mid);
      r = mid - 1;
    } else {
      l = mid + 1;
    }
  }
  printf("%lld\n", ans + m);
  return 0;
}
