import itertools

import math

import fractions

import functools

import copy



n = int(eval(input()))

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



pm = [0,0]



for i in range(n):

    if a[i] == 0:

        print((sum(list(map(abs,a)))))

        quit()

    elif a[i] > 0:

        pm[0] += 1

    else:

        pm[1] += 1

if pm[1] % 2 != 0:

    print((sum(list(map(abs,a))) - 2 * min(list(map(abs,a)))))

else:

    print((sum(list(map(abs,a)))))
import math





def main():

    n = int(eval(input()))

    # a, b, t = map(int, input().split())

    # h = list(map(int, input().split()))

    # s = input()

    # h = [int(input()) for _ in rane(n)]



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

    abs_a = []

    minus = 0

    for ai in a:

        if ai < 0:

            minus += 1

        abs_a.append(abs(ai))



    if minus % 2 == 0:

        print((sum(abs_a)))

    else:

        mini = min(abs_a)

        print((sum(abs_a) - 2*mini))





if __name__ == '__main__':

    main()

import itertools
import math
import fractions
import functools
import copy

n = int(eval(input()))
a = list(map(int, input().split()))
pm = [0, 0]
for i in range(n):
    if a[i] == 0:
        print((sum(list(map(abs, a)))))
        quit()
    elif a[i] > 0:
        pm[0] += 1
    else:
        pm[1] += 1
if pm[1] % 2 != 0:
    print((sum(list(map(abs, a))) - 2 * min(list(map(abs, a)))))
else:
    print((sum(list(map(abs, a)))))

import math


def main():
    n = int(eval(input()))
    # a, b, t = map(int, input().split())
    # h = list(map(int, input().split()))
    # s = input()
    # h = [int(input()) for _ in rane(n)]
    a = list(map(int, input().split()))
    abs_a = []
    minus = 0
    for ai in a:
        if ai < 0:
            minus += 1
        abs_a.append(abs(ai))
    if minus % 2 == 0:
        print((sum(abs_a)))
    else:
        mini = min(abs_a)
        print((sum(abs_a) - 2 * mini))


if __name__ == "__main__":
    main()

-import itertools -import fractions -import functools -import copy -n = int(eval(input())) -a = list(map(int, input().split())) -pm = [0, 0] -for i in range(n): -    if a[i] == 0: -        print((sum(list(map(abs, a))))) -        quit() -    elif a[i] > 0: -        pm[0] += 1 + +def main(): +    n = int(eval(input())) +    # a, b, t = map(int, input().split()) +    # h = list(map(int, input().split())) +    # s = input() +    # h = [int(input()) for _ in rane(n)] +    a = list(map(int, input().split())) +    abs_a = [] +    minus = 0 +    for ai in a: +        if ai < 0: +            minus += 1 +        abs_a.append(abs(ai)) +    if minus % 2 == 0: +        print((sum(abs_a))) -        pm[1] += 1 -if pm[1] % 2 != 0: -    print((sum(list(map(abs, a))) - 2 * min(list(map(abs, a))))) -else: -    print((sum(list(map(abs, a))))) +        mini = min(abs_a) +        print((sum(abs_a) - 2 * mini)) + + +if __name__ == "__main__": +    main()