import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val N = sc.nextInt()
    val M = sc.nextInt()
    val C = sc.nextInt()

    var total = 0

    val bLst = mutableListOf<Int>()
    for (i in 0 until M) {
        bLst.add(sc.nextInt())
    }

    val aLst = mutableListOf<MutableList<Int>>()
    for (i in 0 until N) {
        val tmpLst = mutableListOf<Int>()
        for (j in 0 until M) {
            tmpLst.add(sc.nextInt())
        }
        aLst.add(tmpLst)
    }

    for (i in aLst) {
        var tmp = 0
        for (j in 0 until M) {
            tmp += (bLst[j] * i[j])
        }
        tmp += C

        if (tmp > 0) {
            total++
        }
    }

    println(total)
}