#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  long long n, m;
  scanf("%I64d %I64d", &n, &m);
  if (n <= m) {
    printf("%I64d\n", n);
    return 0;
  }
  n -= m;
  long long cnt = 0;
  while (n > 0) {
    cnt++;
    n -= cnt;
  }
  printf("%I64d\n", cnt + m);
  return 0;
}
