"use strict";
function Main(input) {
  let args = input.split('\n');
  let n = parseInt(args.shift());
  let a = args.shift().split(' ')
  .map(m => parseInt(m));
  let minusCount= a.reduce((ac, cv) => {
    return (ac * cv) < 0 ? -1 : 1;
  });
  a = a.map(m => m < 0 ? -m : m)
  .sort((a, b) => a - b);
  let max = a.reduce((ac, cv) => ac + cv);
  if (minusCount < 0) {
    max -= a.shift() * 2;
  }
  console.log(max);
}


Main(require("fs").readFileSync("/dev/stdin", "utf8"));