#include <bits/stdc++.h>
using namespace std;
const long long M = 1e9 + 100;
long long BSearch(long long a, long long sum) {
  long long l = 1;
  long long r = a;
  long long b;
  while (l <= r) {
    long long mid = (l + r) >> 1;
    if (mid % 2 == 0) {
      b = (mid / 2) * (mid + 1);
    } else {
      b = ((mid + 1) / 2) * mid;
    }
    if (b >= sum) {
      r = mid - 1;
    } else {
      l = mid + 1;
    }
  }
  return l;
}
int main() {
  long long m, n;
  long long day = 0;
  cin >> n >> m;
  if (n <= m) {
    day = n;
  } else {
    day += m;
    n -= m;
    day += BSearch(2 * M, n);
  }
  cout << day << endl;
  return 0;
}
