N = gets.to_i
A = gets.split.map(&:to_i)
B = gets.split.map(&:to_i)

ans = 0

B.each_with_index do |b, idx|
  n = [A[idx], b].min
  b -= n

  m = [A[idx + 1], b].min
  A[idx + 1] -= m

  ans += n + m
end

puts ans
