N = gets.to_i
B = gets.split(" ").map(&:to_i)
A = []
A << B[0]
i = 1
while i < N - 1 do
    if B[i - 1] < B[i]
        A << B[i - 1]
    else
        A << B[i]
    end
    i += 1
end
A << B[-1]
puts A.inject(:+)
