#include #define rep(i,N) for(int i=0;i<(N);i++) #define rrep(i, n) for (int i = (int)n-1; i >= 0; --i) #define FOR(i,a,b) for(int i=(a);i<(b);i++) using namespace std; const long long MOD = 1e9 + 7; const long long INF = 1e12; const int inf = 1e9; const int mod = 1e9+7; typedef long long ll; typedef pair P; typedef set S; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } int main(){ int n; cin >> n; vector a(n); rep(i, n) cin >> a[i]; if(accumulate(a.begin(), a.end(), 0) < 0){ rep(i, n) a[i] *= -1; } sort(a.rbegin(), a.rend()); ll sum_a = 0, sum_b = 0; rep(i,n){ if(i&1){ sum_b += a[i]; }else{ sum_a += a[i]; } } cout << abs(sum_a) - abs(sum_b) << endl; return 0; }