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