object Main extends App {
	val Array(n,m,c) = scala.io.StdIn.readLine.split(" ").map(_.toInt)
	val b = scala.io.StdIn.readLine.split(" ").map(_.toInt)

	var ans = 0

	for(i<-0 until n){
		val tp = scala.io.StdIn.readLine.split(" ").map(_.toInt)
		var tq = c
		for(j<-0 until m){
			tq = tq + tp(j)*b(j)
		}

		if(tq > 0) ans = ans + 1
	}

	println(ans)

}