import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		String[] split = s.split(" ");
		int N = Integer.parseInt(split[0]);
		int M = Integer.parseInt(split[1]);
		int C = Integer.parseInt(split[2]);
		s = sc.nextLine();
		split = s.split(" ");
		int[] b = new int[M];
		for (int i = 0; i < M; i++)
			b[i] = Integer.parseInt(split[i]);

		int cnt = 0;
		for (int i = 0; i < N; i++) {
			s = sc.nextLine();
			split = s.split(" ");
			int sum = 0;
			for (int j = 0; j < M; j++) {
				int ai = Integer.parseInt(split[j]);
				sum += ai * b[j];
			}
			sum += C;
			if (sum > 0)
				cnt++;
		}

		System.out.println(cnt);

		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		String[] split = s.split(" ");
		int N = Integer.parseInt(split[0]);
		int M = Integer.parseInt(split[1]);
		int C = Integer.parseInt(split[2]);
		s = sc.nextLine();
		split = s.split(" ");
		int[] b = new int[M];
		for (int i = 0; i < M; i++)
			b[i] = Integer.parseInt(split[i]);

		int cnt = 0;
		for (int i = 0; i < N; i++) {
			s = sc.nextLine();
			split = s.split(" ");
			int sum = 0;
			for (int j = 0; j < M; j++) {
				int ai = Integer.parseInt(split[j]);
				sum += ai * b[j];
			}
			sum += C;
			if (sum > 0)
				cnt++;
		}

		System.out.println(cnt);

		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		String[] split = s.split(" ");
		int N = Integer.parseInt(split[0]);
		int M = Integer.parseInt(split[1]);
		int C = Integer.parseInt(split[2]);
		s = sc.nextLine();
		split = s.split(" ");
		int[] b = new int[M];
		for (int i = 0; i < M; i++)
			b[i] = Integer.parseInt(split[i]);

		int cnt = 0;
		for (int i = 0; i < N; i++) {
			s = sc.nextLine();
			split = s.split(" ");
			int sum = 0;
			for (int j = 0; j < M; j++) {
				int ai = Integer.parseInt(split[j]);
				sum += ai * b[j];
			}
			sum += C;
			if (sum > 0)
				cnt++;
		}

		System.out.println(cnt);

		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		String[] split = s.split(" ");
		int N = Integer.parseInt(split[0]);
		int M = Integer.parseInt(split[1]);
		int C = Integer.parseInt(split[2]);
		s = sc.nextLine();
		split = s.split(" ");
		int[] b = new int[M];
		for (int i = 0; i < M; i++)
			b[i] = Integer.parseInt(split[i]);

		int cnt = 0;
		for (int i = 0; i < N; i++) {
			s = sc.nextLine();
			split = s.split(" ");
			int sum = 0;
			for (int j = 0; j < M; j++) {
				int ai = Integer.parseInt(split[j]);
				sum += ai * b[j];
			}
			sum += C;
			if (sum > 0)
				cnt++;
		}

		System.out.println(cnt);

		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc String[] split = s.split(" "); split s.split(" ") s.split s " " int N = Integer.parseInt(split[0]); N Integer.parseInt(split[0]) Integer.parseInt Integer split[0] split 0 int M = Integer.parseInt(split[1]); M Integer.parseInt(split[1]) Integer.parseInt Integer split[1] split 1 int C = Integer.parseInt(split[2]); C Integer.parseInt(split[2]) Integer.parseInt Integer split[2] split 2 s = sc.nextLine() s sc.nextLine() sc.nextLine sc split = s.split(" ") split s.split(" ") s.split s " " int[] b = new int[M]; b new int[M] M for (int i = 0; i < M; i++)
			b[i] = Integer.parseInt(split[i]); int i = 0; int i = 0; i 0 i < M i M i++ i++ i b[i] = Integer.parseInt(split[i]); b[i] = Integer.parseInt(split[i]) b[i] b i Integer.parseInt(split[i]) Integer.parseInt Integer split[i] split i int cnt = 0; cnt 0 for (int i = 0; i < N; i++) {
			s = sc.nextLine();
			split = s.split(" ");
			int sum = 0;
			for (int j = 0; j < M; j++) {
				int ai = Integer.parseInt(split[j]);
				sum += ai * b[j];
			}
			sum += C;
			if (sum > 0)
				cnt++;
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			s = sc.nextLine();
			split = s.split(" ");
			int sum = 0;
			for (int j = 0; j < M; j++) {
				int ai = Integer.parseInt(split[j]);
				sum += ai * b[j];
			}
			sum += C;
			if (sum > 0)
				cnt++;
		} {
			s = sc.nextLine();
			split = s.split(" ");
			int sum = 0;
			for (int j = 0; j < M; j++) {
				int ai = Integer.parseInt(split[j]);
				sum += ai * b[j];
			}
			sum += C;
			if (sum > 0)
				cnt++;
		} s = sc.nextLine() s sc.nextLine() sc.nextLine sc split = s.split(" ") split s.split(" ") s.split s " " int sum = 0; sum 0 for (int j = 0; j < M; j++) {
				int ai = Integer.parseInt(split[j]);
				sum += ai * b[j];
			} int j = 0; int j = 0; j 0 j < M j M j++ j++ j {
				int ai = Integer.parseInt(split[j]);
				sum += ai * b[j];
			} {
				int ai = Integer.parseInt(split[j]);
				sum += ai * b[j];
			} int ai = Integer.parseInt(split[j]); ai Integer.parseInt(split[j]) Integer.parseInt Integer split[j] split j sum += ai * b[j] sum ai * b[j] ai b[j] b j sum += C sum C if (sum > 0)
				cnt++; sum > 0 sum 0 cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		String[] split = s.split(" ");
		int N = Integer.parseInt(split[0]);
		int M = Integer.parseInt(split[1]);
		int C = Integer.parseInt(split[2]);
		s = sc.nextLine();
		split = s.split(" ");
		int[] b = new int[M];
		for (int i = 0; i < M; i++)
			b[i] = Integer.parseInt(split[i]);

		int cnt = 0;
		for (int i = 0; i < N; i++) {
			s = sc.nextLine();
			split = s.split(" ");
			int sum = 0;
			for (int j = 0; j < M; j++) {
				int ai = Integer.parseInt(split[j]);
				sum += ai * b[j];
			}
			sum += C;
			if (sum > 0)
				cnt++;
		}

		System.out.println(cnt);

		sc.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		String[] split = s.split(" ");
		int N = Integer.parseInt(split[0]);
		int M = Integer.parseInt(split[1]);
		int C = Integer.parseInt(split[2]);
		s = sc.nextLine();
		split = s.split(" ");
		int[] b = new int[M];
		for (int i = 0; i < M; i++)
			b[i] = Integer.parseInt(split[i]);

		int cnt = 0;
		for (int i = 0; i < N; i++) {
			s = sc.nextLine();
			split = s.split(" ");
			int sum = 0;
			for (int j = 0; j < M; j++) {
				int ai = Integer.parseInt(split[j]);
				sum += ai * b[j];
			}
			sum += C;
			if (sum > 0)
				cnt++;
		}

		System.out.println(cnt);

		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		String[] split = s.split(" ");
		int N = Integer.parseInt(split[0]);
		int M = Integer.parseInt(split[1]);
		int C = Integer.parseInt(split[2]);
		s = sc.nextLine();
		split = s.split(" ");
		int[] b = new int[M];
		for (int i = 0; i < M; i++)
			b[i] = Integer.parseInt(split[i]);

		int cnt = 0;
		for (int i = 0; i < N; i++) {
			s = sc.nextLine();
			split = s.split(" ");
			int sum = 0;
			for (int j = 0; j < M; j++) {
				int ai = Integer.parseInt(split[j]);
				sum += ai * b[j];
			}
			sum += C;
			if (sum > 0)
				cnt++;
		}

		System.out.println(cnt);

		sc.close();
	}
}