import std.stdio, std.range, std.conv, std.string;
import std.algorithm.comparison, std.algorithm.iteration, std.algorithm.mutation, std.algorithm.searching, std.algorithm.setops, std.algorithm.sorting;

void main()
{
    int[] input = readln().split.to!(int[]);
    int N = input[0];
    int M = input[1];
    int C = input[2];
    auto blist = readln().split.to!(int[]);
    int count;
    foreach(int i; 0..N)
    {
        auto sList = readln().split.to!(int[]);
        long sum = 0;
        foreach(int k; 0..M)
        {
            sum += blist[k]*sList[k];
        }
        sum += C;
        count += sum > 0 ? 1 : 0;
    }
    writeln(count);
}