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