#include <bits/stdc++.h>
using namespace std;
using llong = long long;
using ullong = unsigned long long;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
inline int rnd(int l, int r) {
  return uniform_int_distribution<int>(l, r)(rng);
}
unordered_set<ullong> dp[10000];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  llong ans = 0;
  for (int& i : a) cin >> i, ans += -abs(i);
  if (n == 1) {
    cout << a[0];
    exit(0);
  }
  multiset<int> illegal;
  if (n % 2)
    for (int i = 1; i < n; i += 2) illegal.insert(a[i]);
  sort(a.begin(), a.end());
  vector<llong> pref(n);
  pref[0] = a[0];
  for (int i = 1; i < n; ++i) pref[i] = pref[i - 1] + a[i];
  int ones = 0;
  if (n % 3 == 2) ones = 2;
  if (n % 3 == 0) ones = 1;
  for (; ones <= n; ones += 3) {
    llong curSum =
        ones ? -pref[ones - 1] + pref.back() - pref[ones - 1] : pref.back();
    if (n % 2 && ones == illegal.size() &&
        multiset<int>(a.begin(), a.begin() + ones) == illegal) {
      if (ones == 0) continue;
      curSum -= -a[ones - 1];
      curSum += a[ones - 1];
      curSum -= a[ones];
      curSum += -a[ones];
    }
    ans = max(ans, curSum);
  }
  cout << ans;
}
