n=int(input()) L=list(map(int,input().split())) M,m=max(L),min(L) ans=0 if 0<=M: ans+=2*M if m<0: ans+=2*(abs(m)) print(ans)