n = ARGF.gets.to_i
b1 = ARGF.gets.split.map(&:to_i)
b2 = b1.dup
b1.push(b2.last)
b2.unshift(b1.first)
a = n.times.map do |i|
  [b1[i], b2[i]].min
end
# $stderr.puts "#{b1}"
# $stderr.puts "#{b2}"
# $stderr.puts "#{a}"
puts a.inject(&:+)
