#include <stdio.h>
#include <stdlib.h>

int max(int big,int number){
  int max=0;
  for(int i=big;i>big-number;i--){
    max+=i;
  }
  return max;
}

int min(int number){
  int sum=0;
  for(int i=0;i<number;i++){
    sum+=i;
  }
  return sum;
}

int main(void){
  int n,k;
  int i;
  int answer=0;
  scanf("%d%d",&n,&k);
  for(i=k;i<=n+1;i++){
    answer+=max(n,i)-min(i)+1;
  }
  printf("%d",answer);
  return 0;
}
