import java.util.Scanner

fun main(args: Array<String>) {
  val scanner = Scanner(System.`in`)
  val N = scanner.nextInt()
  val M = scanner.nextInt()
  val C = scanner.nextInt()
  val B = IntArray(M + 1)
  var ans = 0
  for (i in 1..M) {
    B[i] = scanner.nextInt()
  }
  for (i in 1..N) {
    var temp = C
    for (j in 1..M) {
      temp += B[j] * scanner.nextInt()
    }
    if (temp > 0) ans++
  }
  print(ans)
  scanner.close()
}