N = gets.to_i
a = []
b = []
a = gets.split.map(&:to_i)
b = gets.split.map(&:to_i)

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

puts ans