n = gets.to_i
bs = gets.split(' ').map(&:to_i)

sum = bs[0]
prev_b = bs[0]

bs.drop(1).each do |b|
  if b >= prev_b
    sum += prev_b
  else
    sum += b
  end
  prev_b = b
end

sum += bs.last

puts sum