N = int(input()) A = list(map(int, input().split())) if sum(A) < 0: A = [-a for a in A] A.sort() X = Y = 0 f = 1 while A: if f: X += A.pop() else: Y += A.pop() f = 1 - f print(abs(X)-abs(Y))