import std.functional,
       std.algorithm,
       std.container,
       std.typetuple,
       std.typecons,
       std.bigint,
       std.string,
       std.traits,
       std.array,
       std.range,
       std.stdio,
       std.conv;

bool judge(int[] A, int[] B, int C, int M) {
  int sum = C;

  foreach (i; 0..M) {
    sum += A[i] * B[i];
  }

  return sum > 0;
}

void main() {
  int[] NMC = readln.chomp.split.to!(int[]);
  int N = NMC[0],
      M = NMC[1],
      C = NMC[2];
  int[] B = readln.chomp.split.to!(int[]);

  int[][] As;
  As.length = N;

  foreach (i; 0..N) {
    As[i] = readln.chomp.split.to!(int[]);
  }

  writeln(As.count!(A => A.judge(B, C, M)));
}