#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int64_t> A(N);
  int minus = 0;
  for(int i = 0; i < N; i++) {
    cin >> A.at(i);
    if(A.at(i) < 0) {
      minus++;
    }
  }
  if(minus % 2 == 0) {
    int64_t ans = 0;
    for(int i = 0; i < N; i++) {
      ans += abs(A.at(i));
    }
    cout << ans << endl;
  }
  else {
    // 絶対値が一番小さいものをaとする
    int64_t a = 1000000000;
    int64_t ans = 0;
    for(int i = 0; i < N; i++) {
      if(abs(A.at(i)) < a) {
        a = abs(A.at(i));
      }
      ans += abs(A.at(i));
    }
    ans -= 2 * a;
    cout << ans << endl;
  }
}
#include<iostream>
#include<vector>
using namespace std;
typedef long long ll;

int main() {
    cin.tie(0);
    cin.sync_with_stdio(0);
    
    int n;
    cin >> n;
    vector<ll> a(n);
    ll sum = 0;
    for (int i = 0; i < n; i++) {
        scanf("%lld", &a[i]);
        sum += a[i];
    }

    ll ans = sum;
    for (int i = 0; i < n - 1; i++) {
        if (a[i] < 0) {
            a[i] *= -1;
            a[i+1] *= -1;
            sum += 2 * a[i];
            sum += 2 * a[i+1];
        }
        ans = max(sum, ans);
    }

    for (int i = n; i >= 1; i--) {
        if (a[i] < 0) {
            a[i] *= -1;
            a[i-1] *= -1;
            sum += 2 * a[i];
            sum += 2 * a[i-1];
        }
        ans = max(sum, ans);
    }
    
    printf("%lld\n", ans);

}