Public Class Program
  Shared Sub Main()
    Dim n As Integer = Integer.Parse(Console.ReadLine())
    Dim b As Long() = Array.ConvertAll(Of String, Long)(Console.ReadLine().Split(" "), AddressOf Long.Parse)
    Dim a(0 To n - 1) As Long
    a(0) = b(0)
    a(1) = b(0)
    For i As Integer = 1 To n - 2
      a(i) = If(a(i) > b(i), b(i), a(i))
      a(i + 1) = b(i)
    Next
    Dim ans As Long = 0
    For i As Integer = 0 To n - 1
      ans += a(i)
    Next
    Console.WriteLine(ans.ToString())
  End Sub
End Class