N = int(input()) C = list(map(int, input().split())) ans = max(0, max(C)) - min(0, min(C)) print(ans * 2)