#include <bits/stdc++.h>
using namespace std;
long long n, m;
long long sum(long long k) { return (1 + k) * k / 2; }
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  long long ans = min(n, m);
  n -= ans;
  if (n) {
    long long low = 1, high = 1LL << 31;
    long long k = 0;
    while (low <= high) {
      long long mid = low + high >> 1;
      if (sum(mid) >= n) {
        k = mid;
        high = mid - 1;
      } else
        low = mid + 1;
    }
    ans += k;
  }
  cout << ans << '\n';
  return 0;
}
