#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
long long mod = 1e9 + 7;
double eps = 1e-9;
double pi = acos(-1);
long long fastpower(long long b, long long p) {
  double ans = 1;
  while (p) {
    if (p % 2) {
      ans = (ans * b);
    }
    b = b * b;
    p /= 2;
  }
  return ans;
}
bool valid(int x, int y, int n, int m) {
  return (x >= 0 && y < m && x < n && y >= 0);
}
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long n, m;
  cin >> n >> m;
  if (n <= m) {
    cout << n;
    return 0;
  }
  long long f = n - m;
  long long l = 1;
  long long r = 2e9;
  long long ans = 0;
  while (l <= r) {
    long long mid = l + (r - l) / 2;
    if (((mid * (mid + 1)) / 2) >= f) {
      r = mid - 1;
      ans = mid;
    } else {
      l = mid + 1;
    }
  }
  cout << m + ans;
  return 0;
}
