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

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

void main() {
    auto nmc = readints;
    int n = nmc[0], m = nmc[1], c = nmc[2];
    auto b = readints;
    int ans = 0;
    for (int i = 0; i < n; i++) {
        auto a = readints;
        if (a.zip(b).map!(e => e[0] * e[1]).sum + c > 0) {
            ans++;
        }
    }
    writeln(ans);
}
