n = gets.strip.to_i
b = gets.strip.split.map(&:to_i)

a = Array.new(n)
sum = 0
a[n-1] = b[n-2]
a[0] = b[0]
sum += a[0] + a[n-1]

(-(n-2)..-1).each do |i|
  a[-i] = [b[-i],b[-i-1]].min
  sum += a[-i]
end
puts sum