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

ret = 0
remain = A[0]
N.times do |i|
  if remain <= B[i]
    power = B[i] - remain
    ret += remain
    if A[i + 1] <= power
      remain = 0
      ret += A[i + 1]
    else
      remain = A[i + 1] - power
      ret += power
    end
  else
    ret += B[i]
    remain = A[i + 1]
  end
end
puts ret