read N M C
read -a B
ANS=0

for ((j=0; j<N; j++)); do
    read -a A
    SUM=$C
    for ((i=0; i<M; i++)); do
        ((SUM+=A[i]*B[i]))
    done
    if ((SUM > 0 )); then
        ((ANS++))
    fi
done

echo $ANS
