import scala.io.StdIn.readLine

object Main extends App {
  val Array(n, m, c) = readLine().split(' ').map(_.toInt)
  val bs = readLine().split(' ').toVector.map(_.toInt)
  
  val result = (0 until n).map { _ =>
    val as = readLine().split(' ').toVector.map(_.toInt)
    val combinations = as.zip(bs)
    val sum = combinations.foldLeft(0) { case (s, (a, b)) =>
      s + a * b
    }
    sum > -c
  }.count(b => b)
  
  println(result)
}