program main
implicit none
integer :: n, l, i, b
integer , allocatable :: a(:)

read(*,*) n, l
allocate( a(n) )
b= n
do i = 1, n
   a(i) = l + i -1
   if( abs( a(i) ) .le. b ) then
      b = a(i)
   end if
end do

write(*,'(i0)') sum(a) -b

end program main
