n,m,c = gets.split(' ').map(&:to_i)
b = gets.split(' ').map(&:to_i)
a = n.times.map{gets.split(' ').map(&:to_i)}
count = 0
n.times do |j|
	sum = 0
	m.times {|i| sum += b[i] * a[j][i]}
	count += 1 if (sum + c > 0)
end

puts count