N = int(input()) C = list(map(int, input().split())) C.sort() x = sum(C[::2]) y = sum(C[1::2]) ans1 = abs(x) - abs(y) C = C[::-1] x = sum(C[::2]) y = sum(C[1::2]) print(max(ans1, abs(x) - abs(y)))