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

public class Main {

	public static void main(String[] args) {

		try(BufferedReader input = new BufferedReader(new InputStreamReader(System.in))){

			String[] l1 = input.readLine().split(" ");
			int N = Integer.parseInt(l1[0]);
			int M = Integer.parseInt(l1[1]);
			int C = Integer.parseInt(l1[2]);

			String[] l2 = input.readLine().split(" ");
			int[] B = new int[M];
			for(int i = 0; i < M; i++) {
				B[i] = Integer.parseInt(l2[i]);
			}

			int cnt = 0;

			for(int i=0; i < N; i++) {
				int calc = 0;
				String[] lines = input.readLine().split(" ");
				for(int j = 0; j < M; j++) {
					calc += Integer.parseInt(lines[j]) * B[j];
				}
				if(calc + C > 0) cnt++;
			}

			System.out.println(cnt);

		} catch (IOException e) {
			e.printStackTrace();
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) {

		try(BufferedReader input = new BufferedReader(new InputStreamReader(System.in))){

			String[] l1 = input.readLine().split(" ");
			int N = Integer.parseInt(l1[0]);
			int M = Integer.parseInt(l1[1]);
			int C = Integer.parseInt(l1[2]);

			String[] l2 = input.readLine().split(" ");
			int[] B = new int[M];
			for(int i = 0; i < M; i++) {
				B[i] = Integer.parseInt(l2[i]);
			}

			int cnt = 0;

			for(int i=0; i < N; i++) {
				int calc = 0;
				String[] lines = input.readLine().split(" ");
				for(int j = 0; j < M; j++) {
					calc += Integer.parseInt(lines[j]) * B[j];
				}
				if(calc + C > 0) cnt++;
			}

			System.out.println(cnt);

		} catch (IOException e) {
			e.printStackTrace();
		}
	}
} Main public static void main(String[] args) {

		try(BufferedReader input = new BufferedReader(new InputStreamReader(System.in))){

			String[] l1 = input.readLine().split(" ");
			int N = Integer.parseInt(l1[0]);
			int M = Integer.parseInt(l1[1]);
			int C = Integer.parseInt(l1[2]);

			String[] l2 = input.readLine().split(" ");
			int[] B = new int[M];
			for(int i = 0; i < M; i++) {
				B[i] = Integer.parseInt(l2[i]);
			}

			int cnt = 0;

			for(int i=0; i < N; i++) {
				int calc = 0;
				String[] lines = input.readLine().split(" ");
				for(int j = 0; j < M; j++) {
					calc += Integer.parseInt(lines[j]) * B[j];
				}
				if(calc + C > 0) cnt++;
			}

			System.out.println(cnt);

		} catch (IOException e) {
			e.printStackTrace();
		}
	} main {

		try(BufferedReader input = new BufferedReader(new InputStreamReader(System.in))){

			String[] l1 = input.readLine().split(" ");
			int N = Integer.parseInt(l1[0]);
			int M = Integer.parseInt(l1[1]);
			int C = Integer.parseInt(l1[2]);

			String[] l2 = input.readLine().split(" ");
			int[] B = new int[M];
			for(int i = 0; i < M; i++) {
				B[i] = Integer.parseInt(l2[i]);
			}

			int cnt = 0;

			for(int i=0; i < N; i++) {
				int calc = 0;
				String[] lines = input.readLine().split(" ");
				for(int j = 0; j < M; j++) {
					calc += Integer.parseInt(lines[j]) * B[j];
				}
				if(calc + C > 0) cnt++;
			}

			System.out.println(cnt);

		} catch (IOException e) {
			e.printStackTrace();
		}
	} try(BufferedReader input = new BufferedReader(new InputStreamReader(System.in))){

			String[] l1 = input.readLine().split(" ");
			int N = Integer.parseInt(l1[0]);
			int M = Integer.parseInt(l1[1]);
			int C = Integer.parseInt(l1[2]);

			String[] l2 = input.readLine().split(" ");
			int[] B = new int[M];
			for(int i = 0; i < M; i++) {
				B[i] = Integer.parseInt(l2[i]);
			}

			int cnt = 0;

			for(int i=0; i < N; i++) {
				int calc = 0;
				String[] lines = input.readLine().split(" ");
				for(int j = 0; j < M; j++) {
					calc += Integer.parseInt(lines[j]) * B[j];
				}
				if(calc + C > 0) cnt++;
			}

			System.out.println(cnt);

		} catch (IOException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} IOException e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {

			String[] l1 = input.readLine().split(" ");
			int N = Integer.parseInt(l1[0]);
			int M = Integer.parseInt(l1[1]);
			int C = Integer.parseInt(l1[2]);

			String[] l2 = input.readLine().split(" ");
			int[] B = new int[M];
			for(int i = 0; i < M; i++) {
				B[i] = Integer.parseInt(l2[i]);
			}

			int cnt = 0;

			for(int i=0; i < N; i++) {
				int calc = 0;
				String[] lines = input.readLine().split(" ");
				for(int j = 0; j < M; j++) {
					calc += Integer.parseInt(lines[j]) * B[j];
				}
				if(calc + C > 0) cnt++;
			}

			System.out.println(cnt);

		} BufferedReader input = new BufferedReader(new InputStreamReader(System.in)) BufferedReader input = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) String[] l1 = input.readLine().split(" "); l1 input.readLine().split(" ") input.readLine().split input.readLine() input.readLine input " " int N = Integer.parseInt(l1[0]); N Integer.parseInt(l1[0]) Integer.parseInt Integer l1[0] l1 0 int M = Integer.parseInt(l1[1]); M Integer.parseInt(l1[1]) Integer.parseInt Integer l1[1] l1 1 int C = Integer.parseInt(l1[2]); C Integer.parseInt(l1[2]) Integer.parseInt Integer l1[2] l1 2 String[] l2 = input.readLine().split(" "); l2 input.readLine().split(" ") input.readLine().split input.readLine() input.readLine input " " int[] B = new int[M]; B new int[M] M for(int i = 0; i < M; i++) {
				B[i] = Integer.parseInt(l2[i]);
			} int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
				B[i] = Integer.parseInt(l2[i]);
			} {
				B[i] = Integer.parseInt(l2[i]);
			} B[i] = Integer.parseInt(l2[i]) B[i] B i Integer.parseInt(l2[i]) Integer.parseInt Integer l2[i] l2 i int cnt = 0; cnt 0 for(int i=0; i < N; i++) {
				int calc = 0;
				String[] lines = input.readLine().split(" ");
				for(int j = 0; j < M; j++) {
					calc += Integer.parseInt(lines[j]) * B[j];
				}
				if(calc + C > 0) cnt++;
			} int i=0; int i=0; i 0 i < N i N i++ i++ i {
				int calc = 0;
				String[] lines = input.readLine().split(" ");
				for(int j = 0; j < M; j++) {
					calc += Integer.parseInt(lines[j]) * B[j];
				}
				if(calc + C > 0) cnt++;
			} {
				int calc = 0;
				String[] lines = input.readLine().split(" ");
				for(int j = 0; j < M; j++) {
					calc += Integer.parseInt(lines[j]) * B[j];
				}
				if(calc + C > 0) cnt++;
			} int calc = 0; calc 0 String[] lines = input.readLine().split(" "); lines input.readLine().split(" ") input.readLine().split input.readLine() input.readLine input " " for(int j = 0; j < M; j++) {
					calc += Integer.parseInt(lines[j]) * B[j];
				} int j = 0; int j = 0; j 0 j < M j M j++ j++ j {
					calc += Integer.parseInt(lines[j]) * B[j];
				} {
					calc += Integer.parseInt(lines[j]) * B[j];
				} calc += Integer.parseInt(lines[j]) * B[j] calc Integer.parseInt(lines[j]) * B[j] Integer.parseInt(lines[j]) Integer.parseInt Integer lines[j] lines j B[j] B j if(calc + C > 0) cnt++; calc + C > 0 calc + C calc C 0 cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args public class Main {

	public static void main(String[] args) {

		try(BufferedReader input = new BufferedReader(new InputStreamReader(System.in))){

			String[] l1 = input.readLine().split(" ");
			int N = Integer.parseInt(l1[0]);
			int M = Integer.parseInt(l1[1]);
			int C = Integer.parseInt(l1[2]);

			String[] l2 = input.readLine().split(" ");
			int[] B = new int[M];
			for(int i = 0; i < M; i++) {
				B[i] = Integer.parseInt(l2[i]);
			}

			int cnt = 0;

			for(int i=0; i < N; i++) {
				int calc = 0;
				String[] lines = input.readLine().split(" ");
				for(int j = 0; j < M; j++) {
					calc += Integer.parseInt(lines[j]) * B[j];
				}
				if(calc + C > 0) cnt++;
			}

			System.out.println(cnt);

		} catch (IOException e) {
			e.printStackTrace();
		}
	}
} public class Main {

	public static void main(String[] args) {

		try(BufferedReader input = new BufferedReader(new InputStreamReader(System.in))){

			String[] l1 = input.readLine().split(" ");
			int N = Integer.parseInt(l1[0]);
			int M = Integer.parseInt(l1[1]);
			int C = Integer.parseInt(l1[2]);

			String[] l2 = input.readLine().split(" ");
			int[] B = new int[M];
			for(int i = 0; i < M; i++) {
				B[i] = Integer.parseInt(l2[i]);
			}

			int cnt = 0;

			for(int i=0; i < N; i++) {
				int calc = 0;
				String[] lines = input.readLine().split(" ");
				for(int j = 0; j < M; j++) {
					calc += Integer.parseInt(lines[j]) * B[j];
				}
				if(calc + C > 0) cnt++;
			}

			System.out.println(cnt);

		} catch (IOException e) {
			e.printStackTrace();
		}
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) {

		try(BufferedReader input = new BufferedReader(new InputStreamReader(System.in))){

			String[] l1 = input.readLine().split(" ");
			int N = Integer.parseInt(l1[0]);
			int M = Integer.parseInt(l1[1]);
			int C = Integer.parseInt(l1[2]);

			String[] l2 = input.readLine().split(" ");
			int[] B = new int[M];
			for(int i = 0; i < M; i++) {
				B[i] = Integer.parseInt(l2[i]);
			}

			int cnt = 0;

			for(int i=0; i < N; i++) {
				int calc = 0;
				String[] lines = input.readLine().split(" ");
				for(int j = 0; j < M; j++) {
					calc += Integer.parseInt(lines[j]) * B[j];
				}
				if(calc + C > 0) cnt++;
			}

			System.out.println(cnt);

		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
