N = gets.chomp.to_i
a = Array.new(N+1)
str = gets.split
for i in 0..N do
    a[i] = str[i].to_i
end
b = Array.new(N)
str = gets.split
for i in 0...N do
    b[i] = str[i].to_i
end

max = 0
n = 0
for i in 0...N do
    if b[i] > a[i]
        max += a[i]
        n = b[i] - a[i]
        if n > a[i+1]
            max += a[i+1]
            a[i+1] = 0
        else
            max += n
            a[i+1] -= n
        end
    else
        max += b[i]
        n = 0
    end
end

puts max