n = int(input()) C = list(map(int, input().split())) s = sum(C) if s < 0: C = [-c for c in C] import heapq q = [] heapq.heapify(q) for c in C: heapq.heappush(q, -c) a = 0 b = 0 for i in range(n): v = -heapq.heappop(q) if i%2 == 0: a += v else: b += v print(abs(a)-abs(b))