object Main {
  def main(args: Array[String]): Unit = {
    def score(inputs: String, b: List[Int], c: Int): Int = {
      inputs.split(" ").map(_.toInt).zip(b).foldLeft(0)((s, x) => s + x._1 * x._2) + c
    }

    val Seq(n, m, c) = io.StdIn.readLine().split(" ").map(_.toInt).toSeq
    val bList = io.StdIn.readLine().split(" ").map(_.toInt).toList
    val count = Iterator.continually(io.StdIn.readLine()).take(n)
      .count(inputs => score(inputs, bList, c) > 0)

    println(count)
  }
}
