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

count = 0
n.times do |i|
  if b[i] > a[i]
    count += a[i]
    b[i] -= a[i]
    if b[i] > a[i+1]
      count += a[i+1]
      a[i+1] = 0
    else
      count += b[i]
      a[i+1] -= b[i]
    end
  else
    count += b[i]
  end
end

puts(count)