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