import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)
  val N, M, C = sc.nextInt
  val B = Array.fill(M)(sc.nextInt)
  val A = Array.fill(N, M)(sc.nextInt)

  val x = (0 until N).map(i => {
    (A(i) zip B).foldLeft(0)((z, ab) => ab._1 * ab._2 + z) + C
  }).count(_ > 0)

  println(x)
}
