n = int(input()) c = list(map(int, input().split())) c.sort() a, b = sum(c[::2]), sum(c[1::2]) print(abs(abs(a) - abs(b)))