object Main extends App{
    val Array(n,m,c) = scala.io.StdIn.readLine.split(" ").map(_.toInt)
    val b = scala.io.StdIn.readLine.split(" ").map(_.toInt)
    val a = for(_ <- 1 to n) yield scala.io.StdIn.readLine.split(" ").map(_.toInt)
    val munya = (for(count1 <- a) yield {
        (for(count2 <- 0 until m) yield {
            count1(count2) * b(count2)
        }).sum
    }).map(_ + c)
    println(munya.count(0 < _))
}
