program answer
  implicit none
  integer :: N, i, ans
  integer, allocatable :: B(:)
  read(*,*) N
  allocate(B(N-1))
  read(*,*) B
  ans=0
  do i = 1, N
     if(i==1) then
        ans=ans+B(i)
     else if(i==N) then
        ans=ans+B(i-1)
     else
        ans=ans+min(B(i-1),B(i))
     end if
  end do
  write(*,*) ans
  stop
 end program answer
