fun main(args: Array<String>) {
    var (n,m,c) = readLine()!!.split(" ").map { s -> s.toInt() }
    var b = readLine()!!.split(" ").map { s -> s.toInt() }
    var count=0
    for (i in 0 until n){
        if(readLine()!!.split(" ").mapIndexed{i,s->b[i]*s.toInt()}.sum()+c>0)count+=1
    }
    println(count)
}