import java.util.Scanner


object Main {
  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val n = sc.nextInt()
    
    var ans = 0
    
    val enemies = new Array[Int](n + 1)
    for (i <- enemies.indices) {
      enemies(i) = sc.nextInt()
    }
    
    val hero = new Array[Int](n)
    for (i <- hero.indices) {
      hero(i) = sc.nextInt()
      
    }
    
    for (i <- hero.indices) {
      if (hero(i) <= enemies(i)) {
        ans += hero(i)
      } else {
        hero(i) -= enemies(i)
        ans += enemies(i) + math.min(enemies(i + 1), hero(i))
      }
    }
    
    println(ans)
  }
  
  def printArray[T](arr: Array[T]): Unit = {
    for (i <- arr.indices) {
      print(s"${arr(i)} ")
    }
    println()
  }
}