import scala.io.{StdIn => in}

object Main extends App {
  val Array(n, m, c) = in.readLine.split(" ").map(_.toInt)
  val b = in.readLine.split(" ").map(_.toInt)
  val a = Iterator.continually(in.readLine)
    .take(n)
    .map(_.split(" ").map(_.toInt))
    .toArray

  var ans = 0
  for(i <- 0 until n) {
    var res = 0
    for(j <- 0 until m) {
      res += a(i)(j) * b(j)
    }
    res += c
    if(res > 0) ans += 1
  }
  println(ans)
}