for(;[m,n]=readline().split(' ');)print((n>+m)-(1+3*m-n)*n*~n/6)