#!/usr/bin/env python3





def main():

    N = int(eval(input()))

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

    A.sort()

    ans = sum(A)

    for i in range(0,N-1,2):

        # print(i)

        tmp = ans - 2*(A[i]+A[i+1])

        if tmp > ans:

            ans = tmp

    print(ans)



if __name__ == "__main__":

    main()

N = int(eval(input()))

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

cnt = 0

for i in range(N):

    if A[i] < 0:

        cnt += 1

A = [abs(a) for a in A]

if cnt % 2 == 0:

    print((sum(A)))

else:

    print((sum(A)-2*min(A)))
#!/usr/bin/env python3
def main():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    A.sort()
    ans = sum(A)
    for i in range(0, N - 1, 2):
        # print(i)
        tmp = ans - 2 * (A[i] + A[i + 1])
        if tmp > ans:
            ans = tmp
    print(ans)


if __name__ == "__main__":
    main()

N = int(eval(input()))
A = list(map(int, input().split()))
cnt = 0
for i in range(N):
    if A[i] < 0:
        cnt += 1
A = [abs(a) for a in A]
if cnt % 2 == 0:
    print((sum(A)))
else:
    print((sum(A) - 2 * min(A)))

-#!/usr/bin/env python3 -def main(): -    N = int(eval(input())) -    A = list(map(int, input().split())) -    A.sort() -    ans = sum(A) -    for i in range(0, N - 1, 2): -        # print(i) -        tmp = ans - 2 * (A[i] + A[i + 1]) -        if tmp > ans: -            ans = tmp -    print(ans) - - -if __name__ == "__main__": -    main() +N = int(eval(input())) +A = list(map(int, input().split())) +cnt = 0 +for i in range(N): +    if A[i] < 0: +        cnt += 1 +A = [abs(a) for a in A] +if cnt % 2 == 0: +    print((sum(A))) +else: +    print((sum(A) - 2 * min(A)))