#include using namespace std; typedef long long ll; typedef pair P; #define REP(i,n) for(ll i=0;i> N; vector c(N); REP(i,N) cin >> c[i]; sort(c.begin(),c.end()); if(c[0]>=0) cout << 2*c[N-1] << endl; else if(c[N-1]>=0) cout << 2*(c[N-1]-c[0]) << endl; else cout << -2*c[0] << endl; return 0; }