#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m;
  scanf("%lld%lld", &n, &m);
  if (n <= m) {
    cout << n - 1 << endl;
    return 0;
  }
  long long int joss = n - m;
  joss = (joss * (joss + 1) / 2) - 1;
  cout << joss + m << endl;
}
