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