#include<stdio.h>
int main(){
  int N,K;
  scanf("%d %d",&N,&K);
  int i,j;
  long int count1=0;
  for(i=K;i<=N+1;i++){
    for(j=0;j<i;j++){
      count1+=(N-j)-j;
    }
  }
  int ans=N+2-K;
  printf("%ld",count1+ans);
}

