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