program main
implicit none

integer :: n,i,ans
integer, allocatable :: a(:)
read(*,*)n
allocate(a(n))
read(*,*)a(1:n)

do i=1,n-1
	if (-(a(i) + a(i+1)) > (a(i) + a(i+1))) then
    	a(i) = -a(i)
        a(i+1) = -a(i+1)
    end if
end do
ans = sum(a)
write(*,*)ans

end program