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

ans = 0

N.times do |i|
  if B[i] > A[i]
    ans += A[i]
    B[i] -= A[i]

    if B[i] > A[i+1]
      ans += A[i+1]
      A[i+1] = 0
    else
      ans += B[i]
      A[i+1] -= B[i]
    end
  else
    ans += B[i]
    B[i] = 0
  end
end

puts ans