function Main(input) {
  reducer = (accumulator, currentValue) => accumulator + currentValue;
  input = input.split("\n");
  tmp = input[0].split(" ");
  tmpb = input[1].split(" ");
  N = parseInt(tmp[0]);
  M = parseInt(tmp[1]);
  C = parseInt(tmp[2]);
  aryb = new Array();
  counter = 0;
  for(var i = 0; i < M; i++ ) {
    aryb.push(tmpb[i]);
  }
  row = N + 2;
  for(var j = 2; j < row; j++ ) {
    a = input[j].split(" ");
    var arya = new Array();
    for(var k = 0; k < M; k++ ) {
      arya.push(a[k] * aryb[k]);
    }
    if(arya.reduce(reducer) + C > 0) {
      counter++;
    }
  }
  console.log(counter);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));