const main = stdin => {
  const input = stdin.trim().split('\n')
  const [N, M, C] = input[0].split(' ').map(x => parseInt(x))
  const Bs = input[1].split(' ').map(x => parseInt(x))

  let count = 0
  for (let i = 0; i < N; i++) {
    let sum = 0
    const srcCode = input[i + 2].split(' ').map(x => parseInt(x))
    for (let j = 0; j < M; j++) {
      sum += srcCode[j] * Bs[j]
    }
    if (sum + C > 0) {
      count++
    }
  }

  console.log(count)
}


// 標準入力
main(require("fs").readFileSync("/dev/stdin", "utf8"))
