import java.util.ArrayList;
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int M= scan.nextInt();
		int C = scan.nextInt();
		ArrayList<Integer> times = new ArrayList();
		ArrayList<Integer> number = new ArrayList();
		int count = 0;
 
		for (int i = 0; i < M; i++){
			int B = scan.nextInt();
			times.add(B);
		}
 
		for (int i = 0; i < N; i++){
			int answer = 0;
 
			for (int j = 0; j < times.size(); j++){
				int A = scan.nextInt();
				number.add(A);
				answer += times.get(j) * number.get(j);
			}
			answer += C;
			if (answer > 0){
				count++;
			}
			number.clear();
		}
		System.out.println(count);
	}
} import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int M= scan.nextInt();
		int C = scan.nextInt();
		ArrayList<Integer> times = new ArrayList();
		ArrayList<Integer> number = new ArrayList();
		int count = 0;
 
		for (int i = 0; i < M; i++){
			int B = scan.nextInt();
			times.add(B);
		}
 
		for (int i = 0; i < N; i++){
			int answer = 0;
 
			for (int j = 0; j < times.size(); j++){
				int A = scan.nextInt();
				number.add(A);
				answer += times.get(j) * number.get(j);
			}
			answer += C;
			if (answer > 0){
				count++;
			}
			number.clear();
		}
		System.out.println(count);
	}
} Main public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int M= scan.nextInt();
		int C = scan.nextInt();
		ArrayList<Integer> times = new ArrayList();
		ArrayList<Integer> number = new ArrayList();
		int count = 0;
 
		for (int i = 0; i < M; i++){
			int B = scan.nextInt();
			times.add(B);
		}
 
		for (int i = 0; i < N; i++){
			int answer = 0;
 
			for (int j = 0; j < times.size(); j++){
				int A = scan.nextInt();
				number.add(A);
				answer += times.get(j) * number.get(j);
			}
			answer += C;
			if (answer > 0){
				count++;
			}
			number.clear();
		}
		System.out.println(count);
	} main {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int M= scan.nextInt();
		int C = scan.nextInt();
		ArrayList<Integer> times = new ArrayList();
		ArrayList<Integer> number = new ArrayList();
		int count = 0;
 
		for (int i = 0; i < M; i++){
			int B = scan.nextInt();
			times.add(B);
		}
 
		for (int i = 0; i < N; i++){
			int answer = 0;
 
			for (int j = 0; j < times.size(); j++){
				int A = scan.nextInt();
				number.add(A);
				answer += times.get(j) * number.get(j);
			}
			answer += C;
			if (answer > 0){
				count++;
			}
			number.clear();
		}
		System.out.println(count);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan int M= scan.nextInt(); M scan.nextInt() scan.nextInt scan int C = scan.nextInt(); C scan.nextInt() scan.nextInt scan ArrayList<Integer> times = new ArrayList(); times new ArrayList() ArrayList<Integer> number = new ArrayList(); number new ArrayList() int count = 0; count 0 for (int i = 0; i < M; i++){
			int B = scan.nextInt();
			times.add(B);
		} int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
			int B = scan.nextInt();
			times.add(B);
		} {
			int B = scan.nextInt();
			times.add(B);
		} int B = scan.nextInt(); B scan.nextInt() scan.nextInt scan times.add(B) times.add times B for (int i = 0; i < N; i++){
			int answer = 0;
 
			for (int j = 0; j < times.size(); j++){
				int A = scan.nextInt();
				number.add(A);
				answer += times.get(j) * number.get(j);
			}
			answer += C;
			if (answer > 0){
				count++;
			}
			number.clear();
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			int answer = 0;
 
			for (int j = 0; j < times.size(); j++){
				int A = scan.nextInt();
				number.add(A);
				answer += times.get(j) * number.get(j);
			}
			answer += C;
			if (answer > 0){
				count++;
			}
			number.clear();
		} {
			int answer = 0;
 
			for (int j = 0; j < times.size(); j++){
				int A = scan.nextInt();
				number.add(A);
				answer += times.get(j) * number.get(j);
			}
			answer += C;
			if (answer > 0){
				count++;
			}
			number.clear();
		} int answer = 0; answer 0 for (int j = 0; j < times.size(); j++){
				int A = scan.nextInt();
				number.add(A);
				answer += times.get(j) * number.get(j);
			} int j = 0; int j = 0; j 0 j < times.size() j times.size() times.size times j++ j++ j {
				int A = scan.nextInt();
				number.add(A);
				answer += times.get(j) * number.get(j);
			} {
				int A = scan.nextInt();
				number.add(A);
				answer += times.get(j) * number.get(j);
			} int A = scan.nextInt(); A scan.nextInt() scan.nextInt scan number.add(A) number.add number A answer += times.get(j) * number.get(j) answer times.get(j) * number.get(j) times.get(j) times.get times j number.get(j) number.get number j answer += C answer C if (answer > 0){
				count++;
			} answer > 0 answer 0 {
				count++;
			} count++ count number.clear() number.clear number System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int M= scan.nextInt();
		int C = scan.nextInt();
		ArrayList<Integer> times = new ArrayList();
		ArrayList<Integer> number = new ArrayList();
		int count = 0;
 
		for (int i = 0; i < M; i++){
			int B = scan.nextInt();
			times.add(B);
		}
 
		for (int i = 0; i < N; i++){
			int answer = 0;
 
			for (int j = 0; j < times.size(); j++){
				int A = scan.nextInt();
				number.add(A);
				answer += times.get(j) * number.get(j);
			}
			answer += C;
			if (answer > 0){
				count++;
			}
			number.clear();
		}
		System.out.println(count);
	}
} public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int M= scan.nextInt();
		int C = scan.nextInt();
		ArrayList<Integer> times = new ArrayList();
		ArrayList<Integer> number = new ArrayList();
		int count = 0;
 
		for (int i = 0; i < M; i++){
			int B = scan.nextInt();
			times.add(B);
		}
 
		for (int i = 0; i < N; i++){
			int answer = 0;
 
			for (int j = 0; j < times.size(); j++){
				int A = scan.nextInt();
				number.add(A);
				answer += times.get(j) * number.get(j);
			}
			answer += C;
			if (answer > 0){
				count++;
			}
			number.clear();
		}
		System.out.println(count);
	}
} Main
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int M= scan.nextInt();
		int C = scan.nextInt();
		ArrayList<Integer> times = new ArrayList();
		ArrayList<Integer> number = new ArrayList();
		int count = 0;
 
		for (int i = 0; i < M; i++){
			int B = scan.nextInt();
			times.add(B);
		}
 
		for (int i = 0; i < N; i++){
			int answer = 0;
 
			for (int j = 0; j < times.size(); j++){
				int A = scan.nextInt();
				number.add(A);
				answer += times.get(j) * number.get(j);
			}
			answer += C;
			if (answer > 0){
				count++;
			}
			number.clear();
		}
		System.out.println(count);
	}
}