import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		Solver solver = new Solver();
		solver.init();
		solver.readHead(in.readLine());
		solver.readB(in.readLine());
		for (; solver.hasNext();) {
			solver.readBody(in.readLine());
		}
		solver.solve();
	}
}

class Solver {
	int N;
	int cnt;

	public void init() {
		N = 0;
		cnt = 0;
	}

	int M;
	int C;
	int[] B;
	int ans;

	public void readHead(String str) {
		String[] strArr = str.split(" ");
		N = Integer.parseInt(strArr[0]);
		// System.out.println(N);
		M = Integer.parseInt(strArr[1]);
		C = Integer.parseInt(strArr[2]);
		B = new int[M];
		ans = 0;
	}

	public void readB(String str) {
		String[] strArr = str.split(" ");
		for (int i = 0; i < M; i++)
			B[i] = Integer.parseInt(strArr[i]);
	}

	public boolean hasNext() {
		return cnt < N;
	}

	public void readBody(String str) {
		// System.out.println(str);
		String[] strArr = str.split(" ");
		int[] a = new int[M];
		for (int i = 0; i < M; i++)
			a[i] = Integer.parseInt(strArr[i]);

		int v = C;
		for (int i = 0; i < M; i++) {
			v += a[i] * B[i];
		}
		if (v > 0)
			ans++;

		cnt++;
	}

	public void solve() {
		System.out.println(ans);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		Solver solver = new Solver();
		solver.init();
		solver.readHead(in.readLine());
		solver.readB(in.readLine());
		for (; solver.hasNext();) {
			solver.readBody(in.readLine());
		}
		solver.solve();
	}
} Main public static void main(String args[]) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		Solver solver = new Solver();
		solver.init();
		solver.readHead(in.readLine());
		solver.readB(in.readLine());
		for (; solver.hasNext();) {
			solver.readBody(in.readLine());
		}
		solver.solve();
	} main {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		Solver solver = new Solver();
		solver.init();
		solver.readHead(in.readLine());
		solver.readB(in.readLine());
		for (; solver.hasNext();) {
			solver.readBody(in.readLine());
		}
		solver.solve();
	} BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) Solver solver = new Solver(); solver new Solver() solver.init() solver.init solver solver.readHead(in.readLine()) solver.readHead solver in.readLine() in.readLine in solver.readB(in.readLine()) solver.readB solver in.readLine() in.readLine in for (; solver.hasNext();) {
			solver.readBody(in.readLine());
		} ; solver.hasNext() solver.hasNext solver {
			solver.readBody(in.readLine());
		} {
			solver.readBody(in.readLine());
		} solver.readBody(in.readLine()) solver.readBody solver in.readLine() in.readLine in solver.solve() solver.solve solver String args[] args class Solver {
	int N;
	int cnt;

	public void init() {
		N = 0;
		cnt = 0;
	}

	int M;
	int C;
	int[] B;
	int ans;

	public void readHead(String str) {
		String[] strArr = str.split(" ");
		N = Integer.parseInt(strArr[0]);
		// System.out.println(N);
		M = Integer.parseInt(strArr[1]);
		C = Integer.parseInt(strArr[2]);
		B = new int[M];
		ans = 0;
	}

	public void readB(String str) {
		String[] strArr = str.split(" ");
		for (int i = 0; i < M; i++)
			B[i] = Integer.parseInt(strArr[i]);
	}

	public boolean hasNext() {
		return cnt < N;
	}

	public void readBody(String str) {
		// System.out.println(str);
		String[] strArr = str.split(" ");
		int[] a = new int[M];
		for (int i = 0; i < M; i++)
			a[i] = Integer.parseInt(strArr[i]);

		int v = C;
		for (int i = 0; i < M; i++) {
			v += a[i] * B[i];
		}
		if (v > 0)
			ans++;

		cnt++;
	}

	public void solve() {
		System.out.println(ans);
	}
} Solver int N; N int cnt; cnt int M; M int C; C int[] B; B int ans; ans public void init() {
		N = 0;
		cnt = 0;
	} init {
		N = 0;
		cnt = 0;
	} N = 0 N 0 cnt = 0 cnt 0 public void readHead(String str) {
		String[] strArr = str.split(" ");
		N = Integer.parseInt(strArr[0]);
		// System.out.println(N);
		M = Integer.parseInt(strArr[1]);
		C = Integer.parseInt(strArr[2]);
		B = new int[M];
		ans = 0;
	} readHead {
		String[] strArr = str.split(" ");
		N = Integer.parseInt(strArr[0]);
		// System.out.println(N);
		M = Integer.parseInt(strArr[1]);
		C = Integer.parseInt(strArr[2]);
		B = new int[M];
		ans = 0;
	} String[] strArr = str.split(" "); strArr str.split(" ") str.split str " " N = Integer.parseInt(strArr[0]) N Integer.parseInt(strArr[0]) Integer.parseInt Integer strArr[0] strArr 0 M = Integer.parseInt(strArr[1]) M Integer.parseInt(strArr[1]) Integer.parseInt Integer strArr[1] strArr 1 C = Integer.parseInt(strArr[2]) C Integer.parseInt(strArr[2]) Integer.parseInt Integer strArr[2] strArr 2 B = new int[M] B new int[M] M ans = 0 ans 0 String str str public void readB(String str) {
		String[] strArr = str.split(" ");
		for (int i = 0; i < M; i++)
			B[i] = Integer.parseInt(strArr[i]);
	} readB {
		String[] strArr = str.split(" ");
		for (int i = 0; i < M; i++)
			B[i] = Integer.parseInt(strArr[i]);
	} String[] strArr = str.split(" "); strArr str.split(" ") str.split str " " for (int i = 0; i < M; i++)
			B[i] = Integer.parseInt(strArr[i]); int i = 0; int i = 0; i 0 i < M i M i++ i++ i B[i] = Integer.parseInt(strArr[i]); B[i] = Integer.parseInt(strArr[i]) B[i] B i Integer.parseInt(strArr[i]) Integer.parseInt Integer strArr[i] strArr i String str str public boolean hasNext() {
		return cnt < N;
	} hasNext {
		return cnt < N;
	} return cnt < N; cnt < N cnt N public void readBody(String str) {
		// System.out.println(str);
		String[] strArr = str.split(" ");
		int[] a = new int[M];
		for (int i = 0; i < M; i++)
			a[i] = Integer.parseInt(strArr[i]);

		int v = C;
		for (int i = 0; i < M; i++) {
			v += a[i] * B[i];
		}
		if (v > 0)
			ans++;

		cnt++;
	} readBody {
		// System.out.println(str);
		String[] strArr = str.split(" ");
		int[] a = new int[M];
		for (int i = 0; i < M; i++)
			a[i] = Integer.parseInt(strArr[i]);

		int v = C;
		for (int i = 0; i < M; i++) {
			v += a[i] * B[i];
		}
		if (v > 0)
			ans++;

		cnt++;
	} String[] strArr = str.split(" "); strArr str.split(" ") str.split str " " int[] a = new int[M]; a new int[M] M for (int i = 0; i < M; i++)
			a[i] = Integer.parseInt(strArr[i]); int i = 0; int i = 0; i 0 i < M i M i++ i++ i a[i] = Integer.parseInt(strArr[i]); a[i] = Integer.parseInt(strArr[i]) a[i] a i Integer.parseInt(strArr[i]) Integer.parseInt Integer strArr[i] strArr i int v = C; v C for (int i = 0; i < M; i++) {
			v += a[i] * B[i];
		} int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
			v += a[i] * B[i];
		} {
			v += a[i] * B[i];
		} v += a[i] * B[i] v a[i] * B[i] a[i] a i B[i] B i if (v > 0)
			ans++; v > 0 v 0 ans++ ans cnt++ cnt String str str public void solve() {
		System.out.println(ans);
	} solve {
		System.out.println(ans);
	} System.out.println(ans) System.out.println System.out System System.out ans
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		Solver solver = new Solver();
		solver.init();
		solver.readHead(in.readLine());
		solver.readB(in.readLine());
		for (; solver.hasNext();) {
			solver.readBody(in.readLine());
		}
		solver.solve();
	}
}

class Solver {
	int N;
	int cnt;

	public void init() {
		N = 0;
		cnt = 0;
	}

	int M;
	int C;
	int[] B;
	int ans;

	public void readHead(String str) {
		String[] strArr = str.split(" ");
		N = Integer.parseInt(strArr[0]);
		// System.out.println(N);
		M = Integer.parseInt(strArr[1]);
		C = Integer.parseInt(strArr[2]);
		B = new int[M];
		ans = 0;
	}

	public void readB(String str) {
		String[] strArr = str.split(" ");
		for (int i = 0; i < M; i++)
			B[i] = Integer.parseInt(strArr[i]);
	}

	public boolean hasNext() {
		return cnt < N;
	}

	public void readBody(String str) {
		// System.out.println(str);
		String[] strArr = str.split(" ");
		int[] a = new int[M];
		for (int i = 0; i < M; i++)
			a[i] = Integer.parseInt(strArr[i]);

		int v = C;
		for (int i = 0; i < M; i++) {
			v += a[i] * B[i];
		}
		if (v > 0)
			ans++;

		cnt++;
	}

	public void solve() {
		System.out.println(ans);
	}
}
