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