"use strict";
const main = input => {
    const n = parseInt(input[0].split(' ')[0], 10);
    const m = parseInt(input[0].split(' ')[1], 10);
    const c = parseInt(input[0].split(' ')[2], 10);
    
     var b=[];
     b = input[1].split(" ").map(Number);
 
    var  i,k = 0;var cnt = 0;
  for(i=0; i<n; i++) {
     var total = 0;
     let a = input[i+2].split(' ').map(Number);;
        for( k=0; k<m; k++) {
            total =total + a[k]*b[k];
      //    console.log(a[k],b[k],total);
        }
        if (total+c>0) {
            cnt++;
              }
    }
    console.log(cnt);
    
}
main(require("fs").readFileSync("/dev/stdin", "utf8").split('\n'));

