fun main(args : Array<String>) {
    val(N,M,C) = readLine()!!.split(" ").map(String::toInt)
    val Bs =  readLine()!!.split(" ").map(String::toInt).toIntArray()
    var count = 0
    println(Array(N){readLine()!!.split(" ").map(String::toInt).toIntArray()}.map{it.foldIndexed(C){index,sum,value -> sum + value*Bs[index]}}.count{it>0})
}
