function Main(input){
  input = input.split("\n");
  inputStr = input[0].split(" ");
  var N = Number.parseInt(inputStr[0]);
  var M = Number.parseInt(inputStr[1]);
  var C = Number.parseInt(inputStr[2]);
  var B_array = input[1].split(" ");
  var A_array = [];
  var tmp = 0;
  var cnt = 0;
  
  for(var i1=0; i1<N ; i1++){
	A_array = input[i1+2].split(" ");
    //console.log(A_array);
    tmp = 0;
    for( var i2=0; i2<M ; i2++){
		tmp += Number.parseInt(B_array[i2]) * Number.parseInt(A_array[i2]);
      	//console.log(tmp);
    }
    if ( tmp + C > 0 ){
      cnt += 1;
    }
  }
  //結果の出力
  console.log(cnt);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

