'use strict'

function Main(input){
  input=input.trim().split(/\s+/).map(x=>x-0);
  var N=input.shift();
  var abs=input.map(x=>Math.abs(x));
  var sign=input.reduce((a,c)=>a*Math.sign(c),1);
  var ans=abs.reduce((a,c)=>a+c)-((sign===-1)?abs.reduce((a,c)=>Math.min(a,c)):0);
  console.log(ans);
}

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