process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = []
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on('line', (line) => {
  lines.push(line);
});

reader.on('close', () => {
 var nmc = lines[0].split(' ');
 var nmc = nmc.map(function(str) { return Number(str)});
 var n = nmc[0];
 var m = nmc[1];
 var c = nmc[2];
 var count = 0;

 var b = lines[1].split(' ');
 var b = b.map(function(str) { return Number(str)});

 for(i=2; i<n+2; i++){
   var sum = c;
   var info = lines[i].split(' ');
   var info = info.map(function(str) { return Number(str)});
   for(j=0; j<m; j++){
     sum += info[j] * b[j]; 
   }
   if(sum>0){
     count++;
   }
   
   }
 
 console.log(count);
});