import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);

		int N = Integer.parseInt(s.next());
		int M = Integer.parseInt(s.next());
		int C = Integer.parseInt(s.next());

		int[][] pro = new int[N + 1][M];
		for (int n = 0; n <= N; n++) {
			for (int m = 0; m < M; m++) {
				pro[n][m] = Integer.parseInt(s.next());
			}
		}

		int counts = 0;
		for (int n = 1; n <= N; n++) {
			int cra = 0;
			for (int m = 0; m < M; m++) {
				cra += pro[n][m] * pro[0][m];
			}
			if (cra + C > 0) {
				counts++;
			}
		}
		System.out.println(counts);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);

		int N = Integer.parseInt(s.next());
		int M = Integer.parseInt(s.next());
		int C = Integer.parseInt(s.next());

		int[][] pro = new int[N + 1][M];
		for (int n = 0; n <= N; n++) {
			for (int m = 0; m < M; m++) {
				pro[n][m] = Integer.parseInt(s.next());
			}
		}

		int counts = 0;
		for (int n = 1; n <= N; n++) {
			int cra = 0;
			for (int m = 0; m < M; m++) {
				cra += pro[n][m] * pro[0][m];
			}
			if (cra + C > 0) {
				counts++;
			}
		}
		System.out.println(counts);
	}
} Main public static void main(String[] args) {
		Scanner s = new Scanner(System.in);

		int N = Integer.parseInt(s.next());
		int M = Integer.parseInt(s.next());
		int C = Integer.parseInt(s.next());

		int[][] pro = new int[N + 1][M];
		for (int n = 0; n <= N; n++) {
			for (int m = 0; m < M; m++) {
				pro[n][m] = Integer.parseInt(s.next());
			}
		}

		int counts = 0;
		for (int n = 1; n <= N; n++) {
			int cra = 0;
			for (int m = 0; m < M; m++) {
				cra += pro[n][m] * pro[0][m];
			}
			if (cra + C > 0) {
				counts++;
			}
		}
		System.out.println(counts);
	} main {
		Scanner s = new Scanner(System.in);

		int N = Integer.parseInt(s.next());
		int M = Integer.parseInt(s.next());
		int C = Integer.parseInt(s.next());

		int[][] pro = new int[N + 1][M];
		for (int n = 0; n <= N; n++) {
			for (int m = 0; m < M; m++) {
				pro[n][m] = Integer.parseInt(s.next());
			}
		}

		int counts = 0;
		for (int n = 1; n <= N; n++) {
			int cra = 0;
			for (int m = 0; m < M; m++) {
				cra += pro[n][m] * pro[0][m];
			}
			if (cra + C > 0) {
				counts++;
			}
		}
		System.out.println(counts);
	} Scanner s = new Scanner(System.in); s new Scanner(System.in) int N = Integer.parseInt(s.next()); N Integer.parseInt(s.next()) Integer.parseInt Integer s.next() s.next s int M = Integer.parseInt(s.next()); M Integer.parseInt(s.next()) Integer.parseInt Integer s.next() s.next s int C = Integer.parseInt(s.next()); C Integer.parseInt(s.next()) Integer.parseInt Integer s.next() s.next s int[][] pro = new int[N + 1][M]; pro new int[N + 1][M] N + 1 N 1 M for (int n = 0; n <= N; n++) {
			for (int m = 0; m < M; m++) {
				pro[n][m] = Integer.parseInt(s.next());
			}
		} int n = 0; int n = 0; n 0 n <= N n N n++ n++ n {
			for (int m = 0; m < M; m++) {
				pro[n][m] = Integer.parseInt(s.next());
			}
		} {
			for (int m = 0; m < M; m++) {
				pro[n][m] = Integer.parseInt(s.next());
			}
		} for (int m = 0; m < M; m++) {
				pro[n][m] = Integer.parseInt(s.next());
			} int m = 0; int m = 0; m 0 m < M m M m++ m++ m {
				pro[n][m] = Integer.parseInt(s.next());
			} {
				pro[n][m] = Integer.parseInt(s.next());
			} pro[n][m] = Integer.parseInt(s.next()) pro[n][m] pro[n] pro n m Integer.parseInt(s.next()) Integer.parseInt Integer s.next() s.next s int counts = 0; counts 0 for (int n = 1; n <= N; n++) {
			int cra = 0;
			for (int m = 0; m < M; m++) {
				cra += pro[n][m] * pro[0][m];
			}
			if (cra + C > 0) {
				counts++;
			}
		} int n = 1; int n = 1; n 1 n <= N n N n++ n++ n {
			int cra = 0;
			for (int m = 0; m < M; m++) {
				cra += pro[n][m] * pro[0][m];
			}
			if (cra + C > 0) {
				counts++;
			}
		} {
			int cra = 0;
			for (int m = 0; m < M; m++) {
				cra += pro[n][m] * pro[0][m];
			}
			if (cra + C > 0) {
				counts++;
			}
		} int cra = 0; cra 0 for (int m = 0; m < M; m++) {
				cra += pro[n][m] * pro[0][m];
			} int m = 0; int m = 0; m 0 m < M m M m++ m++ m {
				cra += pro[n][m] * pro[0][m];
			} {
				cra += pro[n][m] * pro[0][m];
			} cra += pro[n][m] * pro[0][m] cra pro[n][m] * pro[0][m] pro[n][m] pro[n] pro n m pro[0][m] pro[0] pro 0 m if (cra + C > 0) {
				counts++;
			} cra + C > 0 cra + C cra C 0 {
				counts++;
			} counts++ counts System.out.println(counts) System.out.println System.out System System.out counts String[] args args public class Main {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);

		int N = Integer.parseInt(s.next());
		int M = Integer.parseInt(s.next());
		int C = Integer.parseInt(s.next());

		int[][] pro = new int[N + 1][M];
		for (int n = 0; n <= N; n++) {
			for (int m = 0; m < M; m++) {
				pro[n][m] = Integer.parseInt(s.next());
			}
		}

		int counts = 0;
		for (int n = 1; n <= N; n++) {
			int cra = 0;
			for (int m = 0; m < M; m++) {
				cra += pro[n][m] * pro[0][m];
			}
			if (cra + C > 0) {
				counts++;
			}
		}
		System.out.println(counts);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);

		int N = Integer.parseInt(s.next());
		int M = Integer.parseInt(s.next());
		int C = Integer.parseInt(s.next());

		int[][] pro = new int[N + 1][M];
		for (int n = 0; n <= N; n++) {
			for (int m = 0; m < M; m++) {
				pro[n][m] = Integer.parseInt(s.next());
			}
		}

		int counts = 0;
		for (int n = 1; n <= N; n++) {
			int cra = 0;
			for (int m = 0; m < M; m++) {
				cra += pro[n][m] * pro[0][m];
			}
			if (cra + C > 0) {
				counts++;
			}
		}
		System.out.println(counts);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);

		int N = Integer.parseInt(s.next());
		int M = Integer.parseInt(s.next());
		int C = Integer.parseInt(s.next());

		int[][] pro = new int[N + 1][M];
		for (int n = 0; n <= N; n++) {
			for (int m = 0; m < M; m++) {
				pro[n][m] = Integer.parseInt(s.next());
			}
		}

		int counts = 0;
		for (int n = 1; n <= N; n++) {
			int cra = 0;
			for (int m = 0; m < M; m++) {
				cra += pro[n][m] * pro[0][m];
			}
			if (cra + C > 0) {
				counts++;
			}
		}
		System.out.println(counts);
	}
}