'use strict'

class Main {
  solve() {
    const nums = input.nextIntArr();
    const n = nums[0];
    const m = nums[1];
    const lines = input.nextIntArr();
    const table = input.nextIntRange(n);
    console.log(table.filter(line => line.reduce((a,b,i) => a + b * lines[i], -nums[2]) > 0).length);
  }
}

class Input {
  constructor() {
	this.cursor = 0;
	this.inputAll();
  }

  inputAll() {
	this.data = (require("fs").readFileSync("/dev/stdin", "utf8")).split('\n');
	return this.data;
  }

  nextLine(n) {
	if (n) {
	  const ret = this.data.slice(this.cursor, this.cursor + n);
	  this.cursor += n;
	  return ret;
	}
	return this.data[this.cursor++];
  }

  nextStrArr() {
	return this.nextLine().split(' ');
  }

  nextIntArr() {
	return this.nextStrArr().map((e) => parseInt(e));
  }

  nextFloatArr() {
	return this.nextStrArr().map((e) => parseFloat(e));
  }

  nextIntLine(n) {
	return this.nextLine(n).map((e) => parseInt(e))
  }

  nextFloatLine(n) {
	return this.nextLine(n).map((e) => parseFloat(e))
  }

  nextStrRange(n) {
	return this.nextLine(n).map((line) => line.split(' '));
  }

  nextIntRange(n) {
	return this.nextLine(n).map((line) => line.split(' ').map((e) => parseInt(e)));
  }

  nextFloatRange(n) {
	return this.nextLine(n).map((line) => line.split(' ').map((e) => parseFloat(e)));
  }
}

const input = new Input();
(new Main()).solve();
