program ccc

implicit none

integer :: n, i
integer,allocatable,dimension(:) :: a, b

read(*,*) n

allocate(a(n))
allocate(b(n-1))

read(*,*) b

a(1) = b(1)
a(n) = b(n-1)

do i = 2, n-1
a(i) = min(b(i-1),b(i))
end do

write(*,'(i0)') sum(a)

end program