N = int(input()) A = sorted([int(a) for a in input().split()]) print(max(-sum(A[::2])-abs(sum(A[1::2])), sum(A[::-2])-abs(sum(A[-2::-2]))))