program kadai
implicit none
integer  ::  n,l,i,aji

read(*,*) n,l

aji=0
do i=1,n
aji=aji+l+i-1
end do

if (n+l-1<0) then
    aji=aji-(n+l-1)
end if
if (l>0) then
    aji=aji-l
end if

write(*,*) aji

end program kadai
