// abc140-c
object Main extends App {
  val n = io.StdIn.readInt
  val bs = io.StdIn.readLine.split(" ").map(_.toInt)

  def rec(baselist: List[Int], acc: List[Int]): List[Int] = baselist match {
    case head::Nil  => acc:+head
    case head::tail => rec(tail, acc:+math.min(head, tail.head))
  }

  val result = rec(bs.toList, List(bs.head)).sum
  println(result)
}