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

ans = 0
for i in 0..n-1
  atk = b[i]
  if a[i] <= atk
    ans += a[i]
    atk -= a[i]
  else
    ans += atk
    atk = 0
  end
  if a[i+1] <= atk
    ans += a[i+1]
  else
    ans += atk
  end
end

puts ans
