object Main {

  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)

    val N, M, C  = sc.nextInt()
    val B = Array.fill(M)(sc.nextInt())
    val A = Array.fill(N, M)(sc.nextInt())

    println((0 until N) count { i =>
      A(i).zip(B).foldLeft(C) { (r, n) =>
        r + n._1 * n._2
      } > 0
    })
  }

}

