program B
    integer :: N, L, m = 1000000, mi = 0, sum = 0, n
    read*,N, L
    do i = 0 , N - 1, 1
        n = L + i
        sum = sum + n
        if (abs(n) < m) then
            m = abs(n)
            mi = n
        endif
    enddo
    print*, sum - mi
end program B