N = int(input()) C = list(map(int, input().split())) if sum(C) < 0: for i in range(N): C[i] = -C[i] a, b = 0, 0 C.sort(reverse=True) for i in range(N): if i % 2 == 0: a += C[i] else: b += C[i] print(abs(a) - abs(b))