program second
  implicit none
  integer :: n, l, i, k
  integer :: ntas, tas, tas0
  integer, allocatable :: apple(:), absapple(:)
  

  read(*,*) n, l

  allocate(apple(n))
  allocate(absapple(n))

  do i = 1, n
     apple(i) = l + i - 1
     absapple(i) = abs(apple(i))
  end do

  tas0 = minval(absapple)

  ntas = sum(apple)

  do i = 1, n
     if(absapple(i) == tas0) then
        k = i
     end if

  end do

  
  tas = ntas - apple(k)
  write(*,*) tas
end program second



  
