function Main(input){
	input = input.split("\n");
	var mem = input[0].split(" ").map(Number);
	var p = input[1].split(" ").map(Number);
	var sum = 0;
	for(var i=2;i<input.length;i++){
	    var arr = input[i].split(" ").map(Number);
	    var arrsum = 0
	    for(var j=0;j<arr.length;j++){
	        arrsum += arr[j]*p[j];
	    }
	    arrsum += mem[2];
	    if(arrsum>0) sum++;
	}
	console.log(sum)
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());