#include<stdio.h>

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