program sample
  implicit none
  integer N, L, M, k, i, j, e
  read(*,*) N, L
  M = 0
  do i =1, N
  M = M + L + i - 1
  end do
  if ( abs(L + N - 1) >= abs(L )) then
   k = abs(L + N - 1)
  else
   k  = abs (L)
  endif
  do j = 1, N
   if (  abs( L + j - 1) < k) then
    k = abs( L + j - 1)
    e = j
   endif
  end do
  write(*,*) M - L - e + 1
  stop
end program sample 