'use strict';

function Main(input) {
  const N = input.split("\n")[0].split(" ")[0]
  const M = input.split("\n")[0].split(" ")[1]
  const C = input.split("\n")[0].split(" ")[2]
  const B = input.split("\n")[1].split(" ").map(x => Number(x))
  const qList = input.split("\n").slice(2).map(x => x.split(" "))
  let ans = 0
  
  for (let q of qList) {
    let count = 0
    for (let i = 0; i < M; i++) {
        count += q[i] * B[i]
    }
    if (count > -1 * C) {
        ans++
    }
  }

  console.log(ans)
  
};

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
