fun main(args: Array<String>) {
    val (n, m, c) = readLine()!!.split(" ").map { it.toInt() }
    var ans = 0
    val b = readLine()!!.split(" ").map { it.toInt() }
    for(i in 0 until n){
        var now = 0
        val a = readLine()!!.split(" ").map { it.toInt() }
        for(j in 0 until m) {
            now += b[j] * a[j]
        }
        if(now + c > 0)ans++
    }
    println(ans)
}