#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m;
  cin >> n >> m;
  if (m >= n) {
    cout << n << endl;
  } else {
    long double r = sqrt(2 * (n - m) + 0.25) - 0.5;
    long long int ans = (int)r;
    while (ans * (ans + 1) < 2 * (n - m)) {
      ans++;
    }
    cout << m + ans << endl;
  }
}
