#include <bits/stdc++.h>
using namespace std;
int main() {
  long long m, n;
  while (scanf("%lld%lld", &n, &m) != EOF) {
    long long ans = m;
    if (n < m)
      cout << n << endl;
    else if (m == n)
      cout << ans << endl;
    else {
      n -= m;
      n *= 2;
      long long i;
      for (i = sqrt(n) + 1; (i + 1) * i >= n; i--)
        ;
      i++;
      ans += i;
      cout << ans << endl;
    }
  }
  return 0;
}
