#yuki1374
n=int(input())
a=list(map(int,input().split()))
if sum(a)<0:
 a=[-i for i in a]
a.sort()
x=0
y=0
f=1
while a:
 if f:
  x+=a.pop()
 else:
  y+=a.pop()
 f=1-f
print(abs(x)-abs(y))