#include <bits/stdc++.h>
using namespace std;
int tank, money;
int main() {
  int n, v;
  cin >> n >> v;
  for (int i = 1; i <= n; i++) {
    int fillup = min(v, n - i) - tank;
    money += fillup * i;
    tank += fillup - 1;
  }
  cout << money << endl;
}
