#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n, v;
  std::cin >> n >> v;
  int city = 1;
  int fuel = 0;
  int cost = 0;
  fuel = min(n - city, v);
  cost = min(n - city, v);
  fuel--;
  city++;
  while (city != n) {
    if (fuel < n - city) {
      fuel++;
      cost += city;
    }
    city++;
    fuel--;
  }
  cout << cost << endl;
  return 0;
}
