
object Main extends App {
  
  val sc = new java.util.Scanner(System.in)
  val N = sc.nextInt()
  val M = sc.nextInt()
  val C = sc.nextInt()
  sc.useDelimiter("\n")
  val B = sc.next().split(' ').map(_.toInt).toList
  val sums = for (_ <- 0 until N) yield {
    B.zip(sc.next().split(' ').map(_.toInt).toList)
       .map{ case (x, y) => x * y}.sum
  }
  val result = sums.map(sum => if(sum + C > 0) 1 else 0).sum
  println(result) 
}