"use strict";
    
const main = arg => {
    const N = arg.split("\n")[0].split(" ")[0];
    const M = arg.split("\n")[0].split(" ")[1];
    const C = parseInt(arg.split("\n")[0].split(" ")[2]);
    
    const B = arg.split("\n")[1].split(" ").map(n=>parseInt(n));
    const A = arg.split("\n").slice(2);
    
    let cnt = 0;
    
    for(let i=0; i<N; i++) {
        let temp = 0;
        A[i].split(" ").forEach((val,idx)=>temp += val*B[idx]);
        
        if(temp + C > 0) {
            cnt++;
        }
    }
    
    console.log(cnt);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));