N = int(input())
A = sorted([int(a) for a in input().split()])
# X = sum(A[N//2:])
# Y = -sum(A[:N//2])
# print(X - Y)
print(sum(A))