#p gets.to_i ** 3

=begin
n = gets.to_i

a = gets.split(" ").map{|x| x.to_i}
b = gets.split(" ").map{|x| x.to_i}
c = gets.split(" ").map{|x| x.to_i}

temp = -1
sum = 0
n.times do |i|
  sum += c[a[i] - 2] if a[i] == temp + 1
  temp = a[i]
  sum += b[a[i] - 1]
end
p sum
=end

n = gets.to_i
b = Array.new()
b += gets.split(" ").map{|x| x.to_i}
if n == 2
  p b[0] * 2
  exit()
end

b.push(100001, 100001)
b.insert(0, 100001)

sum = 0
n.times do |i|
  #p b[i..(i + 2)]
  sum += b[i..(i + 2)].min
end
p sum
