object Main extends App {
    var get = readLine
    var n = get.split(" ")(0).toInt
    var m = get.split(" ")(1).toInt
    var c = get.split(" ")(2).toInt

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