import 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();
		int[] b = new int[m];
		int[][] a = new int[n][m];
		int answer = 0;
		for(int i = 0; i < m; i++) {
			b[i] = sc.nextInt();
		}
		for(int i = 0; i < n; i++) {
			int total = c;
			for(int j = 0; j < m; j++) {
				a[i][j] = sc.nextInt();
				total += a[i][j]*b[j];
			}
			if(total > 0) answer++;
		}
		System.out.println(answer);
	}

} import java.util.*; util.* java 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();
		int[] b = new int[m];
		int[][] a = new int[n][m];
		int answer = 0;
		for(int i = 0; i < m; i++) {
			b[i] = sc.nextInt();
		}
		for(int i = 0; i < n; i++) {
			int total = c;
			for(int j = 0; j < m; j++) {
				a[i][j] = sc.nextInt();
				total += a[i][j]*b[j];
			}
			if(total > 0) answer++;
		}
		System.out.println(answer);
	}

} 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();
		int[] b = new int[m];
		int[][] a = new int[n][m];
		int answer = 0;
		for(int i = 0; i < m; i++) {
			b[i] = sc.nextInt();
		}
		for(int i = 0; i < n; i++) {
			int total = c;
			for(int j = 0; j < m; j++) {
				a[i][j] = sc.nextInt();
				total += a[i][j]*b[j];
			}
			if(total > 0) answer++;
		}
		System.out.println(answer);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int c = sc.nextInt();
		int[] b = new int[m];
		int[][] a = new int[n][m];
		int answer = 0;
		for(int i = 0; i < m; i++) {
			b[i] = sc.nextInt();
		}
		for(int i = 0; i < n; i++) {
			int total = c;
			for(int j = 0; j < m; j++) {
				a[i][j] = sc.nextInt();
				total += a[i][j]*b[j];
			}
			if(total > 0) answer++;
		}
		System.out.println(answer);
	} 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 int[] b = new int[m]; b new int[m] m int[][] a = new int[n][m]; a new int[n][m] n m int answer = 0; answer 0 for(int i = 0; i < m; i++) {
			b[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
			b[i] = sc.nextInt();
		} {
			b[i] = sc.nextInt();
		} b[i] = sc.nextInt() b[i] b i sc.nextInt() sc.nextInt sc for(int i = 0; i < n; i++) {
			int total = c;
			for(int j = 0; j < m; j++) {
				a[i][j] = sc.nextInt();
				total += a[i][j]*b[j];
			}
			if(total > 0) answer++;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int total = c;
			for(int j = 0; j < m; j++) {
				a[i][j] = sc.nextInt();
				total += a[i][j]*b[j];
			}
			if(total > 0) answer++;
		} {
			int total = c;
			for(int j = 0; j < m; j++) {
				a[i][j] = sc.nextInt();
				total += a[i][j]*b[j];
			}
			if(total > 0) answer++;
		} int total = c; total c for(int j = 0; j < m; j++) {
				a[i][j] = sc.nextInt();
				total += a[i][j]*b[j];
			} int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
				a[i][j] = sc.nextInt();
				total += a[i][j]*b[j];
			} {
				a[i][j] = sc.nextInt();
				total += a[i][j]*b[j];
			} a[i][j] = sc.nextInt() a[i][j] a[i] a i j sc.nextInt() sc.nextInt sc total += a[i][j]*b[j] total a[i][j]*b[j] a[i][j] a[i] a i j b[j] b j if(total > 0) answer++; total > 0 total 0 answer++ answer System.out.println(answer) System.out.println System.out System System.out answer 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();
		int[] b = new int[m];
		int[][] a = new int[n][m];
		int answer = 0;
		for(int i = 0; i < m; i++) {
			b[i] = sc.nextInt();
		}
		for(int i = 0; i < n; i++) {
			int total = c;
			for(int j = 0; j < m; j++) {
				a[i][j] = sc.nextInt();
				total += a[i][j]*b[j];
			}
			if(total > 0) answer++;
		}
		System.out.println(answer);
	}

} 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();
		int[] b = new int[m];
		int[][] a = new int[n][m];
		int answer = 0;
		for(int i = 0; i < m; i++) {
			b[i] = sc.nextInt();
		}
		for(int i = 0; i < n; i++) {
			int total = c;
			for(int j = 0; j < m; j++) {
				a[i][j] = sc.nextInt();
				total += a[i][j]*b[j];
			}
			if(total > 0) answer++;
		}
		System.out.println(answer);
	}

} Main
import 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();
		int[] b = new int[m];
		int[][] a = new int[n][m];
		int answer = 0;
		for(int i = 0; i < m; i++) {
			b[i] = sc.nextInt();
		}
		for(int i = 0; i < n; i++) {
			int total = c;
			for(int j = 0; j < m; j++) {
				a[i][j] = sc.nextInt();
				total += a[i][j]*b[j];
			}
			if(total > 0) answer++;
		}
		System.out.println(answer);
	}

}
