#include <bits/stdc++.h>
const long long INF = 1e18 + 10;
using namespace std;
long long n, m, ans;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  if (n <= m) {
    cout << n;
    exit(0);
  }
  long long l = 0, r = 3e9;
  n -= m;
  while (l <= r) {
    long long mid = (l + r) / 2;
    long long x = mid * (mid + 1) / 2;
    if (x >= n) {
      r = mid - 1;
      ans = mid;
    } else
      l = mid + 1;
  }
  cout << m + ans;
}
