object Main extends App {
    var get = readLine.split(" ")
    var n = get(0).toInt
    var m = get(1).toInt
    var c = get(2).toInt
  
    var get2 = readLine.split(" ")
	val b = new Array[Int](m)
    var a = new Array[Int](m)
    var ans=0
  	for(loop <- 0 to m - 1) {
	  b(loop)=get2(loop).toInt
    }
  	for(loop <- 0 to n - 1){
      var get3 = readLine.split(" ")
      var sum=0
      for(loop2 <- 0 to m - 1){
        sum+=b(loop2)*get3(loop2).toInt
      }
      if(sum+c>0)
      	ans+=1
    }      
  println(ans)
}