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