fun main(args:Array<String>) {
    val n = readLine()!!.toInt()
    val b = readLine()!!.split(" ").map { it.toInt() }
    var before = 0
    var result = b[0]
    for (i in 0..n - 2) {
        if (before > b[i]) {
            result += b[i]
        } else {
            result += before
        }
        before = b[i]
    }
    result += before
    println(result)
}