fun main (args : Array<String>) {
	val (n, m, c) = readLine()!!.split(" ").map(String::toInt)
	val N : Int = n.toInt()
	val M : Int = m.toInt()
	val C : Int = c.toInt()
	val list1 = readLine()!!.split(" ").map(String::toInt)
	var bList : MutableList<Int> = mutableListOf()
	for (i in 0..M - 1) {
		bList.add(list1[i])
	}
	var aList : MutableList<Int> = mutableListOf()
	var calc : Int = 0
	var count : Int = 0
	for (i in 0..N - 1) {
		var list2 = readLine()!!.split(" ").map(String::toInt)
		for (j in 0..M - 1) {
			aList.add(list2[j])
			calc += (bList[j] * aList[j])
		}
		calc += C
		if (calc > 0) {
			count++
		}
		calc = 0
		aList.clear()
	}
	println("${count}")
}