object Main extends App {
  import scala.io.StdIn.readLine
  
  def dot(arr1:List[Int],arr2:List[Int]):Int = {
  	if(arr1.isEmpty || arr2.isEmpty)return 0
    else return arr1.head * arr2.head + dot(arr1.tail,arr2.tail)
  }
  	val state = readLine.split(" ").map(_.toInt);
  	val bline = readLine.split(" ").map(_.toInt).toList;
  	var aline = (0 until state(0)).map(x => readLine.split(" ").map(_.toInt).toList)
  	println( aline.foldLeft(0)((x,y)=>if(dot(y,bline)> 0 - state(2)){x + 1}else x ).toString )
}