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

sum = 0
n.times do |i|
  if i != 0 && (i+1) != n
    if b[i] > b[i-1]
      sum += b[i-1]
    else
      sum += b[i]
    end
  elsif i+1 == n
    sum += b[i-1]
  else
    sum += b[0]
  end
end

puts sum
