program main
    implicit none
    integer ::n,l,i,min1,t,u
    read(*,*) n,l
    
    min1=10000
    
    do i=1,n
        if (abs(l+i-1)<min1)then
            min1=abs(l+i-1)
            t=l+i-1
        end if
    end do
    u=n*(l-1)+n*(n+1)/2 - t
    write(*,*) u
    
    stop
end program main
    