import io.StdIn._

object Main extends App {
  val Seq(n, m, c) = readLine().split(" ").map(_.toInt).toSeq
  val b            = readLine().split(" ").map(_.toInt).toSeq

  require(1 <= n && n <= 20)
  require(1 <= m && m <= 20)
  require(b.forall(i => -100 <= i && i <= 100))

  var i = 0
  var j = 0
  while (i < n) {
    val a = readLine().split(" ").map(_.toInt).toSeq
    require(a.forall(i => -100 <= i && i <= 100))
    if (a.zip(b).map(ab => ab._1 * ab._2).sum + c > 0) j = j + 1
    i = i + 1
  }
  println(j)
}
