#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000000000;
signed main() {
  long long n, m;
  cin >> n >> m;
  if (m >= n) {
    cout << n << endl;
    return 0;
  }
  long long x = 2 * (n - m);
  long long lo = 0, hi = 2000000000;
  long long mid;
  while (lo < hi) {
    mid = lo + (hi - lo) / 2;
    if (mid * (mid + 1) >= x) {
      hi = mid;
    } else {
      lo = mid + 1;
    }
  }
  cout << m + lo << endl;
}
