import scala.io.StdIn.readLine

object MainA {
  def main(args: Array[String]) = {
    val n = readLine.map(_.toInt)
    val as = readLine.split(" ").map(_.toInt)
    val abs = as.map(Math.abs)
    println(abs.sum - abs.min * 2)
  }
}
