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