""" """ N = int(input()) c = list(map(int,input().split())) l = abs(min(0,min(c))) r = max(0,max(c)) print ((l+r)*2)