#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m;
  cin >> n >> m;
  if (n <= m) {
    cout << n << endl;
    return 0;
  }
  n -= m;
  long long int min = 0, max = 2e9, mid;
  while (min < max) {
    mid = (min + max) / 2;
    long long int ans = mid * (mid + 1) / 2;
    if (n > ans)
      min = mid + 1;
    else
      max = mid;
  }
  cout << min + m << endl;
  return 0;
}
