object Main extends App {

  import scala.io.StdIn._

  val n = readInt
  val b = readLine.split("[ ]+").map(_.toInt)
  val a = Array.fill(n)(0)
  a(0) = b(0)
  a(1) = b(0)
  for (i <- 1 until n - 1) {
    a(i + 1) = b(i)
    if (b(i - 1) > b(i))
      a(i) = b(i)
  }
  println(a.sum)
}
