function main(input) {
  const args = input.split('\n');
  const row1 = args[0].split(' ').map(n => parseInt(n, 10));
  const row2 = args[1].split(' ').map(n => parseInt(n, 10)); //B配列
  const N = row1[0], //Aのループ回数
        M = row1[1], //Bのループ回数
        C = row1[2]; //C
  let ans = 0;
  
  for (let i = 2; i < args.length; i++) {
    //初期設定
    ary = args[i].split(' ').map(n => parseInt(n, 10));
    total = C;
    for (let j = 0; j < M; j++) {
      total += ary[j] * row2[j];
    }
    if (total > 0) { ans++; }
  }
  
  console.log(ans);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));