N = gets.to_i
B = gets.split(' ').map(&:to_i)
anser = Array.new(N, 1000000)
index = 0

B.each do |num| 
  anser[index] = [anser[index], num].min
  anser[index+1] = [anser[index+1], num].min
  index += 1
end

puts anser.inject(:+)


an = gets.to_i
b = gets.split.map(&:to_i)

bn = an - 1
count = (b[0] + b[-1])

for i in 1...bn
  count += [b[i-1], b[i]].min
end
puts count
