import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int M = in.nextInt();
		int C = in.nextInt();
		int[] B = new int[M];
		for (int i = 0; i < M; ++i) {
			B[i] = in.nextInt();
		}
		int[][] A = new int[N][M];
		for (int h = 0; h < N; ++h) {
			for (int w = 0; w < M; ++w) {
				A[h][w] = in.nextInt();
			}
		}
		in.close();
		int count = 0;
		for (int i = 0; i < N; ++i) {
			if (isValid(A[i], B, C)) {
				++count;
			}
		}
		System.out.println(count);
	}

	static boolean isValid(int[] A, int[] B, int C) {
		int result = C;
		for (int i = 0; i < A.length; ++i) {
			result += A[i] * B[i];
		}
		if (result > 0) {
			return true;
		} else {
			return false;
		}
	}

} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int M = in.nextInt();
		int C = in.nextInt();
		int[] B = new int[M];
		for (int i = 0; i < M; ++i) {
			B[i] = in.nextInt();
		}
		int[][] A = new int[N][M];
		for (int h = 0; h < N; ++h) {
			for (int w = 0; w < M; ++w) {
				A[h][w] = in.nextInt();
			}
		}
		in.close();
		int count = 0;
		for (int i = 0; i < N; ++i) {
			if (isValid(A[i], B, C)) {
				++count;
			}
		}
		System.out.println(count);
	}

	static boolean isValid(int[] A, int[] B, int C) {
		int result = C;
		for (int i = 0; i < A.length; ++i) {
			result += A[i] * B[i];
		}
		if (result > 0) {
			return true;
		} else {
			return false;
		}
	}

} Main public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int M = in.nextInt();
		int C = in.nextInt();
		int[] B = new int[M];
		for (int i = 0; i < M; ++i) {
			B[i] = in.nextInt();
		}
		int[][] A = new int[N][M];
		for (int h = 0; h < N; ++h) {
			for (int w = 0; w < M; ++w) {
				A[h][w] = in.nextInt();
			}
		}
		in.close();
		int count = 0;
		for (int i = 0; i < N; ++i) {
			if (isValid(A[i], B, C)) {
				++count;
			}
		}
		System.out.println(count);
	} main {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int M = in.nextInt();
		int C = in.nextInt();
		int[] B = new int[M];
		for (int i = 0; i < M; ++i) {
			B[i] = in.nextInt();
		}
		int[][] A = new int[N][M];
		for (int h = 0; h < N; ++h) {
			for (int w = 0; w < M; ++w) {
				A[h][w] = in.nextInt();
			}
		}
		in.close();
		int count = 0;
		for (int i = 0; i < N; ++i) {
			if (isValid(A[i], B, C)) {
				++count;
			}
		}
		System.out.println(count);
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) int N = in.nextInt(); N in.nextInt() in.nextInt in int M = in.nextInt(); M in.nextInt() in.nextInt in int C = in.nextInt(); C in.nextInt() in.nextInt in int[] B = new int[M]; B new int[M] M for (int i = 0; i < M; ++i) {
			B[i] = in.nextInt();
		} int i = 0; int i = 0; i 0 i < M i M ++i ++i i {
			B[i] = in.nextInt();
		} {
			B[i] = in.nextInt();
		} B[i] = in.nextInt() B[i] B i in.nextInt() in.nextInt in int[][] A = new int[N][M]; A new int[N][M] N M for (int h = 0; h < N; ++h) {
			for (int w = 0; w < M; ++w) {
				A[h][w] = in.nextInt();
			}
		} int h = 0; int h = 0; h 0 h < N h N ++h ++h h {
			for (int w = 0; w < M; ++w) {
				A[h][w] = in.nextInt();
			}
		} {
			for (int w = 0; w < M; ++w) {
				A[h][w] = in.nextInt();
			}
		} for (int w = 0; w < M; ++w) {
				A[h][w] = in.nextInt();
			} int w = 0; int w = 0; w 0 w < M w M ++w ++w w {
				A[h][w] = in.nextInt();
			} {
				A[h][w] = in.nextInt();
			} A[h][w] = in.nextInt() A[h][w] A[h] A h w in.nextInt() in.nextInt in in.close() in.close in int count = 0; count 0 for (int i = 0; i < N; ++i) {
			if (isValid(A[i], B, C)) {
				++count;
			}
		} int i = 0; int i = 0; i 0 i < N i N ++i ++i i {
			if (isValid(A[i], B, C)) {
				++count;
			}
		} {
			if (isValid(A[i], B, C)) {
				++count;
			}
		} if (isValid(A[i], B, C)) {
				++count;
			} isValid(A[i], B, C) isValid A[i] A i B C {
				++count;
			} ++count count System.out.println(count) System.out.println System.out System System.out count String[] args args static boolean isValid(int[] A, int[] B, int C) {
		int result = C;
		for (int i = 0; i < A.length; ++i) {
			result += A[i] * B[i];
		}
		if (result > 0) {
			return true;
		} else {
			return false;
		}
	} isValid {
		int result = C;
		for (int i = 0; i < A.length; ++i) {
			result += A[i] * B[i];
		}
		if (result > 0) {
			return true;
		} else {
			return false;
		}
	} int result = C; result C for (int i = 0; i < A.length; ++i) {
			result += A[i] * B[i];
		} int i = 0; int i = 0; i 0 i < A.length i A.length A A.length ++i ++i i {
			result += A[i] * B[i];
		} {
			result += A[i] * B[i];
		} result += A[i] * B[i] result A[i] * B[i] A[i] A i B[i] B i if (result > 0) {
			return true;
		} else {
			return false;
		} result > 0 result 0 {
			return true;
		} return true; true {
			return false;
		} return false; false int[] A A int[] B B int C C public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int M = in.nextInt();
		int C = in.nextInt();
		int[] B = new int[M];
		for (int i = 0; i < M; ++i) {
			B[i] = in.nextInt();
		}
		int[][] A = new int[N][M];
		for (int h = 0; h < N; ++h) {
			for (int w = 0; w < M; ++w) {
				A[h][w] = in.nextInt();
			}
		}
		in.close();
		int count = 0;
		for (int i = 0; i < N; ++i) {
			if (isValid(A[i], B, C)) {
				++count;
			}
		}
		System.out.println(count);
	}

	static boolean isValid(int[] A, int[] B, int C) {
		int result = C;
		for (int i = 0; i < A.length; ++i) {
			result += A[i] * B[i];
		}
		if (result > 0) {
			return true;
		} else {
			return false;
		}
	}

} public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int M = in.nextInt();
		int C = in.nextInt();
		int[] B = new int[M];
		for (int i = 0; i < M; ++i) {
			B[i] = in.nextInt();
		}
		int[][] A = new int[N][M];
		for (int h = 0; h < N; ++h) {
			for (int w = 0; w < M; ++w) {
				A[h][w] = in.nextInt();
			}
		}
		in.close();
		int count = 0;
		for (int i = 0; i < N; ++i) {
			if (isValid(A[i], B, C)) {
				++count;
			}
		}
		System.out.println(count);
	}

	static boolean isValid(int[] A, int[] B, int C) {
		int result = C;
		for (int i = 0; i < A.length; ++i) {
			result += A[i] * B[i];
		}
		if (result > 0) {
			return true;
		} else {
			return false;
		}
	}

} Main
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int M = in.nextInt();
		int C = in.nextInt();
		int[] B = new int[M];
		for (int i = 0; i < M; ++i) {
			B[i] = in.nextInt();
		}
		int[][] A = new int[N][M];
		for (int h = 0; h < N; ++h) {
			for (int w = 0; w < M; ++w) {
				A[h][w] = in.nextInt();
			}
		}
		in.close();
		int count = 0;
		for (int i = 0; i < N; ++i) {
			if (isValid(A[i], B, C)) {
				++count;
			}
		}
		System.out.println(count);
	}

	static boolean isValid(int[] A, int[] B, int C) {
		int result = C;
		for (int i = 0; i < A.length; ++i) {
			result += A[i] * B[i];
		}
		if (result > 0) {
			return true;
		} else {
			return false;
		}
	}

}
