program pie
  implicit none
  integer ::N,L,ful,kake,i,sa
  integer :: tabe

  read(*,*) N,L
  ful=L*N+N*(N-1)/2
  sa=N*1000
  do i=1,N
     kake=ful-L-(i-1)
     if(abs(kake-ful).lt.sa) then
        sa=abs(kake-ful)
        tabe=kake
     endif
  enddo
  write(*,'(i0)') tabe

end program pie