n, m, c = gets.split.map &:to_i
b = gets.split.map &:to_i

a = []

n.times{
	a << (gets.split.map &:to_i)
}

count = 0
a.each{ |al|
	sum = c
	al.each_with_index{ |ae, i|
		sum += ae * b[i]
	}
	
	if sum > 0 then
		count += 1
	end
}

puts count
