object Main extends App {
	val num = io.StdIn.readLine().toInt
	val listB = io.StdIn.readLine().split(" ").map(_.toInt)
	val first = listB(0) * 2
	val t = listB.tail.foldLeft(first)((t, b) => t + b)
	println(t)
}