#!/usr/local/gnu/bin/bash
read n m c
read -a b
v=0
for i in `seq $n`
do
    read -a a
    x=0
    for j in `seq 0 $((m-1))`
    do
        x=$((x+a[j]*b[j]))
    done
    ((x+c>0)) && v=$((v+1))
done
echo $v
