#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  if (n <= m) {
    cout << n;
  } else {
    long long trr = n - m;
    long long r = 1414213580LL;
    long long l = 1;
    long long ans = 0;
    while (l <= r) {
      long long mid = l + (r - l) / 2;
      long long val = mid * (mid + 1) / 2;
      if (val < trr)
        l = mid + 1;
      else if (val == trr) {
        ans = mid;
        break;
      } else {
        ans = mid;
        r = mid - 1;
      }
    }
    ans += m;
    cout << ans;
  }
}
