import std.stdio, std.string, std.conv;
import std.typecons;
import std.algorithm, std.array, std.range, std.container;
import std.math;

void main() {
	auto data = readln.split;
	auto N = data[0].to!int, M = data[1].to!int, C = data[2].to!int;
	auto B = readln.split.to!(int[]);
	
	int ans = 0;
	foreach (i; 0 .. N) {
		auto row = readln.split.to!(int[]);
		M.iota.each!(i => row[i] *= B[i]);
		if (row.sum + C > 0) { ans++; }
	}
	writeln(ans);
	
}