#include <bits/stdc++.h>
using namespace std;
const int N = 100;
long long n, m;
char s[N];
void solve() {
  if (n <= m) {
    printf("%lld\n", n);
    return;
  }
  long long ans = m;
  long long l = 0, r = 2e9, mid;
  while (l < r) {
    mid = (l + r) / 2;
    if (mid * mid + mid >= 2 * (n - m)) {
      r = mid;
    } else {
      l = mid + 1;
    }
  }
  printf("%lld\n", m + l);
}
int main() {
  while (scanf("%lld%lld", &n, &m) != EOF) {
    solve();
  }
  return 0;
}
