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