N = gets.to_i
As = gets.split.map(&:to_i)
Bs = gets.split.map(&:to_i)
ans = 0
Bs.each.with_index{|b,i|
    if As[i] <= b
        ans += As[i]
        rest = b - As[i]
        if As[i+1] <= rest
            ans += As[i+1]
            As[i+1] = 0
        else
            ans += rest
            As[i+1] -= rest
        end
    else
        ans += b
    end
}

puts ans
