object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n, m, c = sc.nextInt()
  val bs = Array.fill(m)(sc.nextInt())
  val loop = 0 until m
  println {
    List.fill(n)(Array.fill(m)(sc.nextInt())).count { as =>
      0 < loop.map(i => bs(i) * as(i)).sum + c
    }
  }
}