fun main(main: Array<String>) {
    val (n, m ,c) = readLine()!!.split(" ").map { it.toInt() }
    val b = readLine()!!.split(" ").map { it.toInt() }
    var sum = 0
    var cnt = 0
    repeat(n) {
        sum = 0
        var a = readLine()!!.split(" ").map { it.toInt() }
        repeat(m) {
            sum += a[it] * b[it]
        }
        if (sum + c > 0) {
            cnt++
        }
    }
    print(cnt)
}