n = map(int, input()) a = list(map(int, input().split())) maxa = max(a) print(sum(max(abs(maxa), abs(x)) for x in a))