program main
	implicit none
	integer(8) :: N, i, zero, all_plus, ans
	integer(8), allocatable :: A(:), hugo(:)
	read(*, *) N
	allocate(A(1:N), hugo(1:N))
	read(*, *) A(1:N)
	zero = 0
	do i = 1, N
		if(A(i) < 0) then
			hugo(i) = -1
		else if(A(i) > 0) then
			hugo(i) = 1
		else
			zero = 1
			exit
		end if
	end do
	if(zero == 0) then
	
		do i = 1, N-2
			if(hugo(i) == -1) then
				hugo(i) = 1
				hugo(i+1) = -hugo(i+1)
			end if
		end do
		if(hugo(N-1)*hugo(N) > 0) then
			all_plus = 1
		else
			all_plus = -1
		end if
	end if

	A(1:N) = abs(A(1:N))
	ans = sum(A(1:N))
	if(zero == 1 .OR. all_plus == 1) then
		write(*, *) ans
	else
		ans = ans - 2*minval(A(1:N))
		write(*, *) ans
	end if
end program main