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