import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val n = sc.nextInt()
  val m = sc.nextInt()
  val c = sc.nextInt()
  val b = (1..m).map { sc.nextInt() }
  val anm = mutableListOf<List<Int>>()
  for (i in 0 until n) {
    val ai = (1..m).map { sc.nextInt() }
    anm.add(ai)
  }
  println(abc121b(n, m, c, b, anm))
}

private fun abc121b(n: Int, m: Int, c: Int, b: List<Int>, anm: List<List<Int>>): Int {
  var count = 0
  for (ai in anm) {
    var sum = 0
    for (j in 0 until m) {
      sum += ai.get(j) * b.get(j)

    }
    sum += c
    if (sum > 0) count++
  }

  return count
}
