      PROGRAM MaximalValue
      IMPLICIT NONE
      integer(16) :: n
      integer(16),allocatable :: c(:),b(:)
      integer(16) :: i
      
      read*,n
      allocate( c(n),b(n-1) )
      read*,b(1:n-1)

      do i = 2,n-1
        c(i) = min( b(i),b(i-1) )
      end do
      c(1) = b(1)
      c(n) = b(n-1)
      
      print*,sum(c)
   !   print*,c
      
      
      END PROGRAM