object Main extends App {
  import scala.io.StdIn._

  val Array(n, m, c) = readLine.trim.split(' ').map(_.toInt)
  val b = readLine.trim.split(' ').map(_.toInt)
  println(
    Array.tabulate(n){_ ⇒
      readLine.trim.split(' ').map(_.toInt)
    }.count(_.zip(b).map{case (a, b) ⇒ a * b}.sum + c > 0)
  )
}