n = gets.chomp.to_i
b_arr = gets.chomp.split(" ").map(&:to_i) + [10**5+1]

a_arr = []
b_arr.each_cons(2).with_index do |(b1, b2), i|
  a_arr[i] = (a_arr[i].nil? ? b1 : [a_arr[i], b1].min)
  if b1 > b2 then
    a_arr[i+1] = b2
  else
    a_arr[i+1] = b1
  end
end

puts a_arr.inject(&:+)
