#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  long long g, d = 1, x;
  if (n == 1)
    d = 1;
  else if (m >= n)
    d = n;
  else {
    d = sqrt(2 * (n - m));
    if (d * (d + 1) < (2 * (n - m))) {
      for (d++;; d++) {
        if (d * (d + 1) >= (2 * (n - m))) break;
      }
    }
    d = d + m;
  }
  cout << d;
  return 0;
}
