program main
  implicit none
  integer(8) i, j, N, L, ans,x
  !read(*, *) (L(i), i = 1,N)
  read(*, *)N, L
  if (L < 0 .and. L+N-1 > 0) then
    i = L
    j = L+N-1
  elseif (L < 0) then
    i = L
    j = L+N-2
  else
    i = L+1
    j = L+N-1
  end if
      ans = 0
    do x = i,j
      ans = ans + x
    end do

  write(*, *) ans
end program main
