function main(input) {
    var i, j, A, ans=0
    var arg = input.split("\n")[0].split(" ")
    var B = input.split("\n")[1].split(" ")
    for (i=0;i<arg[0];i++){
        A = new Array(input.split("\n")[i+2].split(" "))
        var sum = Number(arg[2]);
        for (j=0;j<arg[1];j++){
            sum += Number(A[0][j])*Number(B[j])
        }
        if (sum>0) ans++
    }
    console.log(ans)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));