a = []
a = gets.split.map(&:to_i)
b = []
b = gets.split.map(&:to_i)
c = []
while s = gets
  c.push(s.split.map(&:to_i))
end
cnt=0
for i in 0..a[0]-1
t=0
    for j in 0..a[1]-1
    t+=b[j]*c[i][j]
    end
    t+=a[-1]
    if t>0
        cnt+=1
    end
end
puts cnt
