import scala.io.StdIn._
object Main extends App {
  val Array(n, m, c) = readLine.split(" ").map(_.toInt)
  val b = readLine.split(" ").map(_.toInt)
  println((1 to n).map{ _ =>
    readLine.split(" ").map(_.toInt).zipWithIndex.foldLeft(0) { (acc, t) =>
      acc + t._1 * b(t._2)
    } + c
  }.count(_ > 0))
}
