#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;
using pll = pair<ll,ll>;

#define INF (1LL << 60)
#define MOD 1000000007
#define PI 3.14159265358979323846

#define REP(i,m,n) for(ll (i)=(m),(i_len)=(n);(i)<(i_len);++(i))
#define FORR(i,v) for(auto (i):v)
#define ALL(x) (x).begin(), (x).end()
#define PR(x) cout << (x) << endl
#define PS(x) cout << (x) << " "
#define SZ(x) ((ll)(x).size())
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define REV(x) reverse(ALL((x)))
#define ASC(x) sort(ALL((x)))
#define DESC(x) ASC((x)); REV((x))
#define pb push_back
#define eb emplace_back

int main()
{
    ll N;
    cin >> N;
    vec A(N);
    REP(i,0,N) cin >> A[i];

    ll ng = 0, m = INF, sum = 0;
    REP(i,0,N) {
        if(A[i] < 0) ++ng;
        m = MIN(m,abs(A[i]));
        sum += abs(A[i]);
    }

    if(ng % 2 == 0) PR(sum);
    else PR(sum-m*2);


    return 0;
}

/*



*/
#include <iostream>
#include <algorithm>
using namespace std;

int main(){
  int N, mcount=0;
  cin >> N;
  long long A[N];
  for (int i = 0; i < N; i++){
    cin >> A[i];
    if (A[i]<0){
      mcount++;
      A[i] *= -1;
    }
  }

  long long ans = 0;
  if (mcount%2==0){
    for (int i = 0; i < N; i++){
      ans += A[i];
    }
    printf("%llu\n", ans);
  }else{
    sort(A, A+N);
    for (int i = 1; i < N; i++){
      ans += A[i];
    }
    printf("%llu\n", ans - A[0]);
  }
  
}
