const main = (input) => {
  input = input.split('\n');
  const c = parseInt(input[0].split(' ')[2]);
  const B = input[1].split(' ').map(v=>v|0);
  input = input.slice(2);
  console.log(input.filter(
    v => v.split(' ').reduce((pre,cur,i)=>pre+((cur|0)*B[i]),0)+c>0
  ).length);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
