#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
template <class T>
inline T gcd(T x, T y) {
  if (!y) return x;
  return gcd(y, x % y);
}
template <class T>
inline T mod(T x) {
  if (x < 0)
    return -x;
  else
    return x;
}
const long long INF = 2e18;
const int MOD = 1e9 + 7;
int main(int argc, char* argv[]) {
  if (argc == 2 or argc == 3) freopen(argv[1], "r", stdin);
  if (argc == 3) freopen(argv[2], "w", stdout);
  long long n, m, a1, a2;
  cin >> n >> m;
  if (n <= m)
    cout << n << endl;
  else {
    a1 = ceil((-1 + sqrtl(1 + 8 * (n - m))) / 2.0);
    a2 = ceil((-1 - sqrtl(1 + 8 * (n - m))) / 2.0);
    if (a1 < 0) a1 = INF;
    if (a2 < 0) a2 = INF;
    cout << (min(a1, a2) + m) << endl;
  }
  return 0;
}
