#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, p, zu[10], zu2[10], a, b, f, t, min, min2, ans = 0;
  scanf("%lld %lld", &a, &b);
  if (a <= b)
    ans = a;
  else {
    a = a - b;
    for (min = 0; a > min; a = a - min, min++)
      ;
    ans = min + b;
  }
  printf("%lld\n", ans);
  return 0;
}
