#include<stdio.h>


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