import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int C = sc.nextInt();sc.nextLine();
		String[] B = sc.nextLine().split(" ");
		String[] A = new String[N];
		int AB = 0, cnt = 0;
		String[] AM;
		for(int i = 0;i < N; i++) {
			A[i] = sc.nextLine();
			AB = 0;
			for(int j = 0; j < M; j++) {
				AM = A[i].split(" ");
				AB += Integer.parseInt(AM[j]) * Integer.parseInt(B[j]);
				//System.out.println(Integer.parseInt(AM[j]) + " " + Integer.parseInt(B[j]));
			}
			if(AB + C > 0) cnt++;
		}

		sc.close();
		System.out.println(cnt);
	}

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int C = sc.nextInt();sc.nextLine();
		String[] B = sc.nextLine().split(" ");
		String[] A = new String[N];
		int AB = 0, cnt = 0;
		String[] AM;
		for(int i = 0;i < N; i++) {
			A[i] = sc.nextLine();
			AB = 0;
			for(int j = 0; j < M; j++) {
				AM = A[i].split(" ");
				AB += Integer.parseInt(AM[j]) * Integer.parseInt(B[j]);
				//System.out.println(Integer.parseInt(AM[j]) + " " + Integer.parseInt(B[j]));
			}
			if(AB + C > 0) cnt++;
		}

		sc.close();
		System.out.println(cnt);
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int C = sc.nextInt();sc.nextLine();
		String[] B = sc.nextLine().split(" ");
		String[] A = new String[N];
		int AB = 0, cnt = 0;
		String[] AM;
		for(int i = 0;i < N; i++) {
			A[i] = sc.nextLine();
			AB = 0;
			for(int j = 0; j < M; j++) {
				AM = A[i].split(" ");
				AB += Integer.parseInt(AM[j]) * Integer.parseInt(B[j]);
				//System.out.println(Integer.parseInt(AM[j]) + " " + Integer.parseInt(B[j]));
			}
			if(AB + C > 0) cnt++;
		}

		sc.close();
		System.out.println(cnt);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int C = sc.nextInt();sc.nextLine();
		String[] B = sc.nextLine().split(" ");
		String[] A = new String[N];
		int AB = 0, cnt = 0;
		String[] AM;
		for(int i = 0;i < N; i++) {
			A[i] = sc.nextLine();
			AB = 0;
			for(int j = 0; j < M; j++) {
				AM = A[i].split(" ");
				AB += Integer.parseInt(AM[j]) * Integer.parseInt(B[j]);
				//System.out.println(Integer.parseInt(AM[j]) + " " + Integer.parseInt(B[j]));
			}
			if(AB + C > 0) cnt++;
		}

		sc.close();
		System.out.println(cnt);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int M = sc.nextInt(); M sc.nextInt() sc.nextInt sc int C = sc.nextInt(); C sc.nextInt() sc.nextInt sc sc.nextLine() sc.nextLine sc String[] B = sc.nextLine().split(" "); B sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " String[] A = new String[N]; A new String[N] N int AB = 0 AB 0 cnt = 0; cnt 0 String[] AM; AM for(int i = 0;i < N; i++) {
			A[i] = sc.nextLine();
			AB = 0;
			for(int j = 0; j < M; j++) {
				AM = A[i].split(" ");
				AB += Integer.parseInt(AM[j]) * Integer.parseInt(B[j]);
				//System.out.println(Integer.parseInt(AM[j]) + " " + Integer.parseInt(B[j]));
			}
			if(AB + C > 0) cnt++;
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			A[i] = sc.nextLine();
			AB = 0;
			for(int j = 0; j < M; j++) {
				AM = A[i].split(" ");
				AB += Integer.parseInt(AM[j]) * Integer.parseInt(B[j]);
				//System.out.println(Integer.parseInt(AM[j]) + " " + Integer.parseInt(B[j]));
			}
			if(AB + C > 0) cnt++;
		} {
			A[i] = sc.nextLine();
			AB = 0;
			for(int j = 0; j < M; j++) {
				AM = A[i].split(" ");
				AB += Integer.parseInt(AM[j]) * Integer.parseInt(B[j]);
				//System.out.println(Integer.parseInt(AM[j]) + " " + Integer.parseInt(B[j]));
			}
			if(AB + C > 0) cnt++;
		} A[i] = sc.nextLine() A[i] A i sc.nextLine() sc.nextLine sc AB = 0 AB 0 for(int j = 0; j < M; j++) {
				AM = A[i].split(" ");
				AB += Integer.parseInt(AM[j]) * Integer.parseInt(B[j]);
				//System.out.println(Integer.parseInt(AM[j]) + " " + Integer.parseInt(B[j]));
			} int j = 0; int j = 0; j 0 j < M j M j++ j++ j {
				AM = A[i].split(" ");
				AB += Integer.parseInt(AM[j]) * Integer.parseInt(B[j]);
				//System.out.println(Integer.parseInt(AM[j]) + " " + Integer.parseInt(B[j]));
			} {
				AM = A[i].split(" ");
				AB += Integer.parseInt(AM[j]) * Integer.parseInt(B[j]);
				//System.out.println(Integer.parseInt(AM[j]) + " " + Integer.parseInt(B[j]));
			} AM = A[i].split(" ") AM A[i].split(" ") A[i].split A[i] A i " " AB += Integer.parseInt(AM[j]) * Integer.parseInt(B[j]) AB Integer.parseInt(AM[j]) * Integer.parseInt(B[j]) Integer.parseInt(AM[j]) Integer.parseInt Integer AM[j] AM j Integer.parseInt(B[j]) Integer.parseInt Integer B[j] B j if(AB + C > 0) cnt++; AB + C > 0 AB + C AB C 0 cnt++ cnt sc.close() sc.close sc 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) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int C = sc.nextInt();sc.nextLine();
		String[] B = sc.nextLine().split(" ");
		String[] A = new String[N];
		int AB = 0, cnt = 0;
		String[] AM;
		for(int i = 0;i < N; i++) {
			A[i] = sc.nextLine();
			AB = 0;
			for(int j = 0; j < M; j++) {
				AM = A[i].split(" ");
				AB += Integer.parseInt(AM[j]) * Integer.parseInt(B[j]);
				//System.out.println(Integer.parseInt(AM[j]) + " " + Integer.parseInt(B[j]));
			}
			if(AB + C > 0) cnt++;
		}

		sc.close();
		System.out.println(cnt);
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int C = sc.nextInt();sc.nextLine();
		String[] B = sc.nextLine().split(" ");
		String[] A = new String[N];
		int AB = 0, cnt = 0;
		String[] AM;
		for(int i = 0;i < N; i++) {
			A[i] = sc.nextLine();
			AB = 0;
			for(int j = 0; j < M; j++) {
				AM = A[i].split(" ");
				AB += Integer.parseInt(AM[j]) * Integer.parseInt(B[j]);
				//System.out.println(Integer.parseInt(AM[j]) + " " + Integer.parseInt(B[j]));
			}
			if(AB + C > 0) cnt++;
		}

		sc.close();
		System.out.println(cnt);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int C = sc.nextInt();sc.nextLine();
		String[] B = sc.nextLine().split(" ");
		String[] A = new String[N];
		int AB = 0, cnt = 0;
		String[] AM;
		for(int i = 0;i < N; i++) {
			A[i] = sc.nextLine();
			AB = 0;
			for(int j = 0; j < M; j++) {
				AM = A[i].split(" ");
				AB += Integer.parseInt(AM[j]) * Integer.parseInt(B[j]);
				//System.out.println(Integer.parseInt(AM[j]) + " " + Integer.parseInt(B[j]));
			}
			if(AB + C > 0) cnt++;
		}

		sc.close();
		System.out.println(cnt);
	}

}