"use strict";
function Main(input) {
    let lines = input.split("\n");
    let Ln = lines.shift().split(/\s/).map((v) => v - 0);
    let N = Ln[0], M = Ln[1], C = Ln[2];
    let Bn = lines.shift().split(/\s/).map((v) => v - 0);
    let ans = 0;
    for (let n = 0; n < N; n++) {
        let An = lines.shift().split(/\s/).map((v) => v - 0);
        let sum = Bn.reduce((ac, value, index) => ac + value * An[index], C);
        if (sum > 0) ans += 1;
    }
    console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
