object Main{
	def main(args:Array[String]){
		val s = new java.util.Scanner(System.in)
		val n = s.nextInt
		val a = Array.fill(n)(s.nextLong)
		for(i <- 0 to n - 2) {
			if(a(i) < 0) {
				a(i) *= -1
				a(i + 1) *= -1
			}
		}

		val sum=a.sum

		println(math.max(sum,sum-(a(0)+a(n-1))*2))
	}
}
