let N = Int(readLine()!)!
var A = readLine()!.characters.split(" ").map{Int(String($0))!}
let B = readLine()!.characters.split(" ").map{Int(String($0))!}
var ans = 0
for i in 0..<N {
  ans += min(min(A[i],B[i])+A[i+1],B[i])
  A[i+1] -= min(A[i+1],B[i]-min(A[i],B[i]))
}
print(ans)