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
  k = M
  do j = 1, N
   if (  abs( M - L - j + 1) <= k) then
    k = abs(M - 2 *L - 2 * j + 2)
    e = j
   endif
  end do
  write(*,*) M  - e + 1 
  stop
end program sample