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

void main() {
    const tmp = readln.split.to!(long[]);
    const N = tmp[0], M = tmp[1], C = tmp[2];
    const bs = readln.split.to!(long[]);
    N.iota.map!(_ => readln.split.to!(long[]).dotProduct(bs) + C > 0 ? 1 : 0).sum.writeln;
}

