#include <bits/stdc++.h>
using namespace std;
vector<pair<long long int, long long int> > vn, vm;
int main() {
  cin.tie(0), cerr.tie(0), ios_base::sync_with_stdio(0);
  long long int n, m;
  cin >> n >> m;
  if (m >= n) {
    cout << n << endl;
    exit(0);
  }
  long long int l = n - m;
  if (l >= 1) {
    long long int p = 1 + 8 * l;
    long long int g = sqrt(p);
    long long int vl = (sqrt(p) - 1) / 2;
    if (p != g * g) m = m + 1;
    cout << m + vl << endl;
    exit(0);
  }
  return 0;
}
