import numpy as np N = int(input()) C = np.fromstring(input(), dtype=np.int64, sep=' ') if C.sum() < 0: C = -C C = np.sort(C)[::-1] ans = np.abs(np.sum(C[0::2])) - np.abs(np.sum(C[1::2])) print(ans)