fun main(args: Array<String>) {
    val (n,m,c) = readLine()!!.split(" ").map { it.toInt() }
    val b = readLine()!!.split(" ").map { it.toInt() }
    val a = (1..n).map{ readLine()!!.split(" ").map { it.toInt() }}

    a.map { list->
        list.mapIndexed { i,it->it*b[i] }.sum()+c
    }.count{ it>0 }.let { println(it) }
}