'use strict'

function main(input) {
  let a = input.split('\n').map(v => v.split(' ').map(v => ~~v))
  a = a.slice(0, -1)
  const n = a[0][0]
  const m = a[0][1]
  const c = a[0][2]
  const b = a[1]
  let d = a.slice(2, a.length)
  //   console.log(b)
  //   console.log(d[1])
  //   console.log(d[2])

  let cnt = 0
  for (let i = 0; i < n; i++) {
    let tmp = 0
    for (let j = 0; j < m; j++) {
      tmp += d[i][j] * b[j]
    }
    // tmp += c
    if (tmp + c > 0) cnt++
  }

  console.log(cnt)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))
