#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, m;
  cin >> n >> m;
  if (m >= n) {
    cout << n << '\n';
    return;
  }
  long long lo = 0;
  long long hi = 2e9;
  while (lo + 1 < hi) {
    long long md = lo + (hi - lo) / 2;
    if (n - md * (md + 1) / 2 <= m) {
      hi = md;
    } else {
      lo = md;
    }
  }
  cout << m + hi << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
