program main 
  
  implicit none
  integer :: n
  integer,allocatable :: a(:)
  integer,allocatable :: b(:)
  integer :: i
  
  read(*,*) n
  allocate( a(n) )
  allocate( b(n-1) )
  read(*,*) b

  do i = 1, n-1
    if( i == 1 ) then
      a(1) = b(1) 
      cycle
    end if
    if( b(i+1) >= b(i) ) then
      a(i) = b(i)
    else
      a(i) = b(i-1)
    end if
  end do
  a(n) = b(n-1) 
  
  print*, sum( a )
end program main 
