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