#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x;
  cin >> n >> x;
  int len = x;
  int u = 1;
  for (int i = n - x; i >= 1; i--) {
    len += i * u++;
  }
  cout << len << endl;
}
