#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long MAXN = 2e5 + 30;
const long long MINN = 1e3 + 20;
const long long MOD2 = 998244353ll;
const long long INF = 74592896151251;
const long double EPS = 1e-9;
long long gcd(long long a, long long b) { return (b ? gcd(b, a % b) : a); }
long long mod(long long n) {
  while (n < 0) n += MOD;
  return n % MOD;
}
long long pow(long long a, long long b) {
  return (!b ? 1 : pow(a, b / 2) * pow(a, b / 2) * (b % 2 ? a : 1));
}
long long n, m;
inline bool Can(long long x) {
  if (x < m) return true;
  x -= m;
  long long cur = (x & 1 == 1) ? (x + 1) / 2 * x : (x / 2) * (x + 1);
  return (cur < n - m);
}
int Main() {
  cin >> n >> m;
  if (n <= m) return cout << n, 0;
  long long High = m + 2e9, Low = -1, Middle;
  while (High - Low > 1) {
    Middle = (High + Low) / 2;
    if (Can(Middle))
      Low = Middle;
    else
      High = Middle;
  }
  cout << Low + 1;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  int q;
  q = 1;
  while (q--) Main();
  return 0;
}
