#include <bits/stdc++.h>
using namespace std;
const int dx[9] = {0, 1, -1, 0, 0, -1, -1, 1, 1};
const int dy[9] = {0, 0, 0, -1, 1, -1, 1, -1, 1};
const double pi = acos(-1.0);
const int N = 110;
long long n, m, ans;
void input_data() { cin >> n >> m; }
void get_ans() {
  if (n <= m) {
    ans = n;
    return;
  }
  n -= (m + 1);
  if (n <= 0) {
    ans = m + 1;
    return;
  }
  long long l = 0, r = 2e9 + 2, t = 0;
  ans = m;
  while (l <= r) {
    long long mid = (l + r) >> 1;
    long long temp = (mid + 2) * (mid - 1) / 2;
    if (temp >= n) {
      t = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  ans += t;
}
void o() { cout << ans << endl; }
int main() {
  input_data();
  get_ans();
  o();
  return 0;
}
