import scala.io.StdIn._

object Main extends App {

  val Array(n,m,c) = readLine().split(" ").map(_.toInt)
  val B = readLine().split(" ").map(_.toInt)
  val A = Array.fill(n)(readLine().split(" ").map(_.toInt))

  def solve() = {
    A.map { list =>
      (0 until m).foldLeft(0) { (acc, i) =>
        acc + (B(i) * list(i))
      }
    }.count(_ + c > 0)
  }
  println(solve())

}

