n = gets.chomp.to_i
b = gets.split.map(&:to_i)
a = Array.new(n)

a[0] = b[0]
a[n-1] = b[n-2]
(1..(n-2)).each do |i|
  if b[i-1] < b[i]
    a[i] = b[i-1]
  elsif b[i-1] > b[i]
    a[i] = b[i]
  else
    a[i] = b[i]
  end
end

puts a.inject(:+)