#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, x, cnt, z;
  cin >> n >> x;
  long long ans = n;
  cnt = 2;
  z = 1;
  while ((x + z) < n) {
    ans += (cnt * (n - (x + z)));
    cnt++;
    z++;
  }
  cout << ans << "\n";
  return 0;
}
