#include <bits/stdc++.h>
using namespace std;
unsigned long long f;
unsigned long long search(unsigned long long l, unsigned long long r) {
  if (l >= r) return l;
  unsigned long long c = l + r;
  c /= 2;
  unsigned long long ans;
  if (c & 1)
    ans = c + 1, ans /= 2, ans *= c;
  else
    ans = c, ans /= 2, ans *= c + 1;
  if (ans == f) return c;
  if (ans < f) return search(c + 1, r);
  if (ans > f) return search(l, c);
}
int main() {
  unsigned long long n, m;
  cin >> n >> m;
  f = n - m;
  if (n <= m) {
    cout << n;
  } else {
    unsigned long long ans = search(1, 1500000000);
    cout << m + ans;
  }
  return 0;
}
