#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, v;
  while (scanf("%d%d", &n, &v) != EOF) {
    if (v >= n - 1)
      printf("%d\n", n - 1);
    else {
      int cost = v;
      for (int i = 0, j = 2; i < n - 1 - v; i++, j++) cost += j;
      printf("%d\n", cost);
    }
  }
  return 0;
}
