import sys

input = sys.stdin.readline



N = int(eval(input()))

A = list(map(int, input().split()))

cnt = 0



for Ai in A:

    if Ai<0:

        cnt += 1



if cnt%2==0:

    print((sum(abs(Ai) for Ai in A)))

else:

    A.sort(key=lambda x: abs(x))

    print((-abs(A[0])+sum(abs(Ai) for Ai in A[1:])))
import sys

input = sys.stdin.readline



N = int(eval(input()))

A = list(map(int, input().split()))

dp = [[0]*2 for _ in range(N)]

dp[0][1] = -10**18



for i in range(N-1):

    dp[i+1][0] = max(dp[i][0]+A[i], dp[i][1]-A[i])

    dp[i+1][1] = max(dp[i][0]-A[i], dp[i][1]+A[i])



print((max(dp[-1][0]+A[-1], dp[-1][1]-A[-1])))
import sys

input = sys.stdin.readline
N = int(eval(input()))
A = list(map(int, input().split()))
cnt = 0
for Ai in A:
    if Ai < 0:
        cnt += 1
if cnt % 2 == 0:
    print((sum(abs(Ai) for Ai in A)))
else:
    A.sort(key=lambda x: abs(x))
    print((-abs(A[0]) + sum(abs(Ai) for Ai in A[1:])))

import sys

input = sys.stdin.readline
N = int(eval(input()))
A = list(map(int, input().split()))
dp = [[0] * 2 for _ in range(N)]
dp[0][1] = -(10**18)
for i in range(N - 1):
    dp[i + 1][0] = max(dp[i][0] + A[i], dp[i][1] - A[i])
    dp[i + 1][1] = max(dp[i][0] - A[i], dp[i][1] + A[i])
print((max(dp[-1][0] + A[-1], dp[-1][1] - A[-1])))

-cnt = 0 -for Ai in A: -    if Ai < 0: -        cnt += 1 -if cnt % 2 == 0: -    print((sum(abs(Ai) for Ai in A))) -else: -    A.sort(key=lambda x: abs(x)) -    print((-abs(A[0]) + sum(abs(Ai) for Ai in A[1:]))) +dp = [[0] * 2 for _ in range(N)] +dp[0][1] = -(10**18) +for i in range(N - 1): +    dp[i + 1][0] = max(dp[i][0] + A[i], dp[i][1] - A[i]) +    dp[i + 1][1] = max(dp[i][0] - A[i], dp[i][1] + A[i]) +print((max(dp[-1][0] + A[-1], dp[-1][1] - A[-1])))