function Main(input) {

    input = input.split("\n");

    tmp0 = input[0].split(' ');
    tmp1 = input[1].split(' ');

    var N = parseInt(tmp0[0], 10);
    var M = parseInt(tmp0[1], 10);
    var C = parseInt(tmp0[2], 10);

    for (var i = 0; i < M; i++) {
        tmp1[i] = parseInt(tmp1[i], 10);
    }

    var count = 0

    var value = 0


    for (var i = 0; i < N; i++) {
        var sum = 0

        tmp = input[i + 2].split(" ");

        for (var j = 0; j < M; j++) {
            tmp[j] = parseInt(tmp[j], 10);
        }

        for (var k = 0; k < M; k++) {
            value = tmp[k] * tmp1[k];
            sum += value;
        }

        if (sum + C > 0) {
            count++;
        }
    }

    console.log(count);
}

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