import java.util.Scanner


object Main {
  val sc = new Scanner(System.in)

  def main(args: Array[String]): Unit = {
    val n = sc.nextInt
    val m = sc.nextInt

    val c = sc.nextInt

    val b = List.fill(m){
      sc.nextInt
    }

    val a = List.fill(n){
      List.fill(m){
        sc.nextInt
      }
    }

    def culc(target: List[Int]): Boolean ={
      (target zip b).map{case (x,y) => x * y}.sum + c > 0
    }

    //    val res = a.filter(culc(_)).size
    val res = a.count(culc)

    println(res)
  }


}