//#include <bits/stdc++.h>
#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <climits>
#include <iomanip>
#include <stack>
#include <bitset>

#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define ROF(i, j, k) for(int i = (int)(j); i >= (int)(k); --i)
#define FORLL(i, n, m) for(long long i = n; i < (long long)(m); i++)
#define SORT(v, n) sort(v, v+n)
#define REVERSE(v) reverse((v).begin(), (v).end())

using namespace std;
using ll = long long;
const ll MOD=1000000007LL;
typedef pair<int, int> P;

ll ADD(ll x, ll y) { return (x+y) % MOD; }
ll SUB(ll x, ll y) { return (x-y+MOD) % MOD; }
ll MUL(ll x, ll y) { return x*y % MOD; }
ll POW(ll x, ll e) { ll v=1; for(; e; x=MUL(x,x), e>>=1) if (e&1) v = MUL(v,x); return v; }
ll DIV(ll x, ll y) { /*assert(y%MOD!=0);*/ return MUL(x, POW(y, MOD-2)); }

template<class T> bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T> bool chmin(T &a,const T &b){if(a>b){a=b;return 1;}return 0;}

int
main(void){  
  ios_base::sync_with_stdio(false);
  cin.tie(0);

  int n;
  cin >> n;
  vector<ll> a(n), a_cpy(n);
  REP(i,n) cin >> a[i];

  /*
  FOR(i,1,n-1){
    int minus = 0, plus = 0;
    FOR(j,i-1,i+2){
      if(a[j] < 0) minus++;
      else plus++;
    }
    if(plus == 3) {
      //ans_l = ans_l + a[i-1] + a[i] + a[i+1];
      continue;
    }
    else if(plus == 1 && minus == 2){
      //ans_l = ans_l + abs(a[i-1]) + abs(a[i]) + abs(a[i+1]);
      a[i-1] = abs(a[i-1]);
      a[i] = abs(a[i]);
      a[i+1] = abs(a[i+1]);            
    }
    else if(plus == 2 && minus == 1){
      if(i == n-2){
	ll tmp = 0LL;
	if(abs(a[i-1]) <= abs(a[i]) && abs(a[i-1]) <= abs(a[i+1])){
	  if(a[i-1] > 0) a[i-1] = -a[i-1];	  
	  a[i] = abs(a[i]);
	  a[i+1] = abs(a[i+1]);
	}
	else if(abs(a[i]) <= abs(a[i-1]) && abs(a[i]) <= abs(a[i+1])){
	  if(a[i] > 0) a[i] = -a[i];	  	  
	  a[i-1] = abs(a[i-1]);
	  a[i+1] = abs(a[i+1]);
	}
	else{
	  if(a[i+1] > 0) a[i+1] = -a[i+1];	  	  
	  a[i-1] = abs(a[i-1]);
	  a[i] = abs(a[i]);	
	}
      }
      else{
	a[i-1] = abs(a[i-1]);
	a[i] = abs(a[i]);
	if(a[i+1] > 0) a[i+1] = -a[i+1];
      }
    }
    else{
      if(i == n-2){
	if(abs(a[i-1]) <= abs(a[i]) && abs(a[i-1]) <= abs(a[i+1])){
	  if(a[i-1] > 0) a[i-1] = -a[i-1];	  
	  a[i] = abs(a[i]);
	  a[i+1] = abs(a[i+1]);
	}
	else if(abs(a[i]) <= abs(a[i-1]) && abs(a[i]) <= abs(a[i+1])){
	  if(a[i] > 0) a[i] = -a[i];	  	  
	  a[i-1] = abs(a[i-1]);
	  a[i+1] = abs(a[i+1]);
	}
	else{
	  if(a[i+1] > 0) a[i+1] = -a[i+1];	  	  
	  a[i-1] = abs(a[i-1]);
	  a[i] = abs(a[i]);	
	}
      }
      else{
	a[i-1] = abs(a[i-1]);
	a[i] = abs(a[i]);
	if(a[i+1] > 0) a[i+1] = -a[i+1];
      }
    }
  }
  
  ll ans = 0LL;
  REP(i, n){
    ans += a[i];
  }
  cout << ans << endl;
  */
  vector<ll> b;
  ll bsum = 0LL;
  int cnt = 0;
  REP(i, n){
    if(a[i] < 0) cnt++;
    b.push_back(abs(a[i]));
    bsum += abs(a[i]);
  }
  sort(b.begin(), b.end());
  //cerr << bsum << endl;
  //cerr << "cnt:" << cnt << endl;
  if(cnt%2){
    //cerr << b[0] << endl;
    bsum -= b[0]*2;
  }

  cout << bsum << endl;
  
  return 0;
}


Measured memory_bytes: 3064