n = int(input()) c = list(map(int, input().split())) minc = abs(min(min(c), 0)) maxc = abs(max(max(c), 0)) print(minc * 2 + maxc * 2)