program apple
implicit none
integer::N,L,mi,miab,S,i
read(*,*)N,L
S=0
miab=10000
mi=0
do i=1,N
	S=S+L+i-1
    if(abs(L+i-1)<miab)then !絶対値の最小値のときの値を探す
    	miab=abs(L+i-1)
    	mi=L+i-1
    end if
end do
write(*,*)S-mi
end program apple