import sys input = sys.stdin.readline N=int(input()) A=list(map(int,input().split())) if sum(A)<0: A=[-a for a in A] A.sort(reverse=True) X=0 Y=0 for i in range(len(A)): if i%2==0: X+=A[i] else: Y+=A[i] print(abs(X)-abs(Y))