#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7 / 4;
long long INF = LLONG_MAX / 4;
vector<string> &split(const std::string &s, char delim, vector<string> &e) {
  stringstream ss(s);
  string item;
  while (getline(ss, item, delim)) e.push_back(item);
  return e;
}
long long Pow(long long a, long long b, long long Mo) {
  long long ans = 1;
  for (; b; b >>= 1, a = a * a % Mo)
    if (b & 1) ans = ans * a % Mo;
  return ans;
}
vector<int> Zfunc(string &s) {
  int n = s.length();
  vector<int> z(n, 0);
  for (int i = 1, l = 0, r = 0; i < n; i++) {
    if (i <= r) z[i] = min(z[i - l], r - i + 1);
    while (i + z[i] < n && s[i + z[i]] == s[z[i]]) z[i]++;
    if (r < i + z[i] - 1) l = i, r = i + z[i] - 1;
  }
  return z;
}
long long solve() { return 0; }
int main(int argc, char const *argv[]) {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, m;
  cin >> n >> m;
  long long ans;
  if (n <= m) {
    ans = n;
  } else {
    long long x = n - m;
    ans = 3e9;
    long long l = 0, u = ans;
    while (l <= u) {
      long long mi = (l + u) / 2;
      long long s = mi * (mi + 1) / 2;
      if (x > s) {
        l = mi + 1;
      } else {
        ans = min(ans, mi);
        u = mi - 1;
      }
    }
    ans = ans + m;
  }
  cout << ans;
  return 0;
}
