def main():

    N = int(eval(input()))

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

    negative = 0

    result = 0

    abs_minimum = 10**9

    for a in A:

        abs_minimum = min(abs_minimum, abs(a))

        if a < 0:

            negative += 1

    if negative % 2 == 0:

        for a in A:

            result += abs(a)

    else:

        for a in A:

            if abs(a) == abs_minimum:

                result += min(a, -a)

            else:

                result += abs(a)

    print(result)





if __name__ == '__main__':

    main()
def main():

    n = int(eval(input()))

    a = [int(x) for x in input().split()]

    count_negative = 0

    for i in range(n):

        if a[i] < 0:

            count_negative += 1

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

    answer = sum(a)

    if count_negative % 2:

        answer -= 2 * min(a)

    print(answer)





if __name__ == '__main__':

    main()



def main():
    N = int(eval(input()))
    A = list(map(int, input().split(" ")))
    negative = 0
    result = 0
    abs_minimum = 10**9
    for a in A:
        abs_minimum = min(abs_minimum, abs(a))
        if a < 0:
            negative += 1
    if negative % 2 == 0:
        for a in A:
            result += abs(a)
    else:
        for a in A:
            if abs(a) == abs_minimum:
                result += min(a, -a)
            else:
                result += abs(a)
    print(result)


if __name__ == "__main__":
    main()

def main():
    n = int(eval(input()))
    a = [int(x) for x in input().split()]
    count_negative = 0
    for i in range(n):
        if a[i] < 0:
            count_negative += 1
    a = [abs(x) for x in a]
    answer = sum(a)
    if count_negative % 2:
        answer -= 2 * min(a)
    print(answer)


if __name__ == "__main__":
    main()

-    N = int(eval(input())) -    A = list(map(int, input().split(" "))) -    negative = 0 -    result = 0 -    abs_minimum = 10**9 -    for a in A: -        abs_minimum = min(abs_minimum, abs(a)) -        if a < 0: -            negative += 1 -    if negative % 2 == 0: -        for a in A: -            result += abs(a) -    else: -        for a in A: -            if abs(a) == abs_minimum: -                result += min(a, -a) -            else: -                result += abs(a) -    print(result) +    n = int(eval(input())) +    a = [int(x) for x in input().split()] +    count_negative = 0 +    for i in range(n): +        if a[i] < 0: +            count_negative += 1 +    a = [abs(x) for x in a] +    answer = sum(a) +    if count_negative % 2: +        answer -= 2 * min(a) +    print(answer)