'use strict';

function Main(input) {
    input = input.split("\n");
    let tmp = input[0].split(" ");

    const M = tmp[1];
    const C = parseInt(tmp[2]);

    const B = input[1].split(" ");

    const A = input.slice(2);

    let count = 0;

    for (var a of A) {
        const tmp = a.split(" ").map((v, i) => v * B[i]).reduce((v, x) => x + v);
        if (tmp + C > 0)
            count++;

    }
    console.log(count);

}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));