import java.util.*

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val n = scanner.nextInt()
    var enemy = Array(n+1, {0L})
    var brave = Array(n, {0L})
    var sum = 0L
    for(i in 0..n){
        enemy[i] = scanner.nextLong()
    }
    for(i in 0..n-1){
        brave[i] = scanner.nextLong()
    }
    for(i in 0..n-1){
        if(enemy[i] >= brave[i]){
            sum += brave[i]
        }
        else if(enemy[i]+enemy[i+1] >= brave[i]){
            sum += brave[i]
            enemy[i+1] -= brave[i]-enemy[i]
        }
        else{
            sum += enemy[i]+enemy[i+1]
            enemy[i+1] = 0L
        }
    }
    println(sum)
}