fun main(args: Array<String>) {
    val (n, m, c) = readLine()!!.split(' ').map(String::toInt)
    val b = readLine()!!.split(' ').map(String::toInt)
    val ans = (1..n).count {
        val ab = readLine()!!.split(' ')
            .map(String::toInt)
            .foldIndexed(0) { index, acc, a -> acc + a * b[index] }
        0 < ab + c
    }
    println(ans)
}
