'use strict'
const main = (sdi) => {
  const line = sdi.split("\n");
  let a = new Array(line.length);
  for(const i in line){
    a[i] = line[i].split(" ").map( str => parseInt(str, 10) );
  }
  let c = 0;
  for(let i=2; i<a.length; i++){
    let r = 0;
    for(let j=0; j<a[0][1]; j++){
      r = r + a[i][j]*a[1][j];
    }
    r = r + a[0][2];
    if(r>0){
      c++;
    }
  }
  console.log(c);
}

main(require('fs').readFileSync('/dev/stdin', 'UTF-8'));