'use strict'

function main(input) {
    const args = input.split('\n');
    const oneL = args[0].split(' ');

    const N = parseInt(oneL[0], 10);
    const M = parseInt(oneL[1], 10);
    const C = parseInt(oneL[2], 10);
    
    const B = args[1].split(' ').map(b => parseInt(b, 10));

    const A = args.slice(2).map(a => {
        return a.split(' ').map(ai => parseInt(ai, 10))
    }); // [[1, 2, 3], [1, 2, 3], ..]

    let count = 0;

    for (let i = 0; i < N; i++) {
        let sum = C;
        for (let j = 0; j < M; j++) {
            sum += A[i][j] * B[j];
        }
        if (sum > 0) count++;
    }

    console.log(count);
}
 
main(require('fs').readFileSync('/dev/stdin', 'utf8'));