function Main(input){
	input = input.split("\n");
  var NMC = input.shift().split(" ").map(a=>~~a);
  var M = NMC[1];
  var C = NMC[2];
  var B = input.shift().split(" ").map(a=>~~a);
  
  var count = 0;
  
  while(input.length){
  	var A = input.shift();
   	A = A.split(" ").map(a=>~~a);
    var sum = 0;
    for(var i = 0; i < M;i++){
    	sum += A[i] * B[i];
    }
    sum += C;
    if(sum > 0)count++;
  }
  return count;
}

// If you are interested in the algorithms I used, 
// there is no need to read down from this line.

((b,c,d)=>"undefined"!=typeof require?console.log(Main(require("fs").readFileSync("/dev/stdin","utf8"))):[b=b.split("\n").slice(1,-1).join("\n"),c=function(){try{return Main(b)}catch(f){return f.stack||f.message}}(),d=typeof c,"string"==d||(c=JSON.stringify(c)),$("<form>").append([[10,b],0,[1,d],0,[10,c]].map(f=>$(f?"<textarea>":"<br>",f&&{rows:f[0],cols:40,text:f[1]}))).appendTo("body")])(`
5 2 -4
-2 5
100 41
100 40
-3 0
-6 -2
18 -13
`);