#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const int mod = 1e9 + 7;
long long n, m;
int main() {
  scanf("%I64d%I64d", &n, &m);
  if (n == 1) {
    printf("1\n");
    return 0;
  }
  if (m >= n) {
    printf("%I64d\n", n);
    return 0;
  }
  long long ret = m + 1;
  if (n == m + 1) {
    printf("%I64d\n", ret);
    return 0;
  }
  long long tmp = sqrt(n * 2) + 1;
  long long l = 1, r = min(n - m, tmp);
  while (l <= r) {
    long long mid = l + r >> 1;
    long long tmp2 = m + mid;
    long long tmp1 = n - (mid - 1) * (mid) / 2;
    if (tmp1 > tmp2)
      ret = m + mid + 1, l = mid + 1;
    else if (tmp1 == tmp2) {
      ret = mid + m;
      break;
    } else
      r = mid - 1;
  }
  cout << ret << endl;
  return 0;
}
