#!/usr/bin/env python3

#D

import numpy as np

import math

import re



n = int(eval(input()))

a = eval(input())

a = re.split(" ",a)

a = list(map(int,a))

count = 0

sum = 0

for i in range(n):

    if(a[i] < 0):

        count += 1

if(count %2 == 0):

    for j in a:

        sum += abs(j)

    print(sum)

else:

    min = 10**9

    t = 0

    for i in range(n):

        if(min > abs(a[i])):

            min = abs(a[i])

            t = i

    for j in range(n):

        if j != t:

            sum += abs(a[j])

        else:

            sum -= abs(a[j])

    

    print(sum)
#!/usr/bin/env python3

#ABC125 D



n = int(eval(input()))

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

cnt = 0

mi = float('inf')

tmp = 0

for i in range(n):

    if a[i] < 0:

        cnt += 1

    if mi > abs(a[i]):

        mi = abs(a[i])

        tmp = i

s = list([abs(x) for x in a])

if cnt % 2:

    print((sum(s)-2*s[tmp]))

else:

    print((sum(s)))

#!/usr/bin/env python3
# D
import numpy as np
import math
import re

n = int(eval(input()))
a = eval(input())
a = re.split(" ", a)
a = list(map(int, a))
count = 0
sum = 0
for i in range(n):
    if a[i] < 0:
        count += 1
if count % 2 == 0:
    for j in a:
        sum += abs(j)
    print(sum)
else:
    min = 10**9
    t = 0
    for i in range(n):
        if min > abs(a[i]):
            min = abs(a[i])
            t = i
    for j in range(n):
        if j != t:
            sum += abs(a[j])
        else:
            sum -= abs(a[j])
    print(sum)

#!/usr/bin/env python3
# ABC125 D
n = int(eval(input()))
a = list(map(int, input().split()))
cnt = 0
mi = float("inf")
tmp = 0
for i in range(n):
    if a[i] < 0:
        cnt += 1
    if mi > abs(a[i]):
        mi = abs(a[i])
        tmp = i
s = list([abs(x) for x in a])
if cnt % 2:
    print((sum(s) - 2 * s[tmp]))
else:
    print((sum(s)))

-# D -import numpy as np -import math -import re - +# ABC125 D -a = eval(input()) -a = re.split(" ", a) -a = list(map(int, a)) -count = 0 -sum = 0 +a = list(map(int, input().split())) +cnt = 0 +mi = float("inf") +tmp = 0 -        count += 1 -if count % 2 == 0: -    for j in a: -        sum += abs(j) -    print(sum) +        cnt += 1 +    if mi > abs(a[i]): +        mi = abs(a[i]) +        tmp = i +s = list([abs(x) for x in a]) +if cnt % 2: +    print((sum(s) - 2 * s[tmp])) -    min = 10**9 -    t = 0 -    for i in range(n): -        if min > abs(a[i]): -            min = abs(a[i]) -            t = i -    for j in range(n): -        if j != t: -            sum += abs(a[j]) -        else: -            sum -= abs(a[j]) -    print(sum) +    print((sum(s)))