#include<stdio.h>

int main(void){
  int n,k,m,mm,i;
  long int sum;
  sum = 0;
  scanf("%d %d", &n,&k);
  for(i=k;i<n+2;i++){
    m = (0 + i -1) * i / 2;
    mm = (2*n-i + 1) * i / 2;
    sum += mm - m + 1;
  }
  printf("%ld", sum);
  return 0;
}