#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  int c;
  c = a - b - 1;
  if (c < 1)
    cout << (a - 1) << endl;
  else {
    long long int d;
    c++;
    d = b + (c * (c + 1) / 2) - 1;
    cout << d << endl;
  }
  return 0;
}
