import java.util.Scanner

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val m = sc.nextInt()
    val c = sc.nextInt()

    val coefficients = parseList(sc, m)
    val result = calc(sc, n, coefficients, c)
    println(result.size)
}

private fun parseList(scanner: Scanner, length: Int): List<Int> {
    return (0 until length).map {
        scanner.nextInt()
    }
}

private fun calc(scanner: Scanner, length: Int, coefficients: List<Int>, c: Int): List<Int> {
    return (0 until length).map {
        coefficients.map { co ->
            val num = scanner.nextInt()
            num * co
        }.sum() + c
    }.filter { it > 0 }
}
