function main(input) {
  const s = input.split("\n");

  const N = parseInt(s[0]);
  const AS = s[1].split(" ").map(function(n) { return parseInt(n, 10); });
  const CS = AS.slice();

  var is = true;

  for(var i=0; i<N-1; i++) {
    if(AS[i] < 0) {
      AS[i] *= -1;
      is = false;
    }
  }

  var sum = 0;

  if (is) {
    for(var i=0; i<N; i++) {
      sum += CS[i];
    }
  } else {
    var min = AS[0];

    for(var i=0; i<N; i++) {
      if(AS[i] < min) {
        min = AS[i]
      }
    }

    for(var i=0; i<N; i++) {
      sum += AS[i];
    }

    sum = sum - min - min;
  }

  console.log(sum);
}

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