import java.util.*;
public class Main {

	private static int X(int [] a, int [] b, int C) {
		int num = 0;
		int sum = C;
		for (int i = 0; i < a.length; i++) {
			sum += a[i] * b[i];

		}
		if (sum > 0)
			num = 1;
		return num;
	}
	
	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 [][] A = new int [N][M];
		int [] B = new int [M];
		
		for ( int j = 0; j < M; j++) {
			B[j] = sc.nextInt();
		}
		
		for ( int i = 0; i < N; i++) {
			for ( int j = 0; j < M; j++) {
				A[i][j] = sc.nextInt();
			}
		}
		
		int result = 0; 
		int count;
		for ( int i = 0; i < N; i++) {
			result += X(A[i], B, C);
		}
		
		System.out.println(result);
	}

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

	private static int X(int [] a, int [] b, int C) {
		int num = 0;
		int sum = C;
		for (int i = 0; i < a.length; i++) {
			sum += a[i] * b[i];

		}
		if (sum > 0)
			num = 1;
		return num;
	}
	
	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 [][] A = new int [N][M];
		int [] B = new int [M];
		
		for ( int j = 0; j < M; j++) {
			B[j] = sc.nextInt();
		}
		
		for ( int i = 0; i < N; i++) {
			for ( int j = 0; j < M; j++) {
				A[i][j] = sc.nextInt();
			}
		}
		
		int result = 0; 
		int count;
		for ( int i = 0; i < N; i++) {
			result += X(A[i], B, C);
		}
		
		System.out.println(result);
	}

} Main private static int X(int [] a, int [] b, int C) {
		int num = 0;
		int sum = C;
		for (int i = 0; i < a.length; i++) {
			sum += a[i] * b[i];

		}
		if (sum > 0)
			num = 1;
		return num;
	} X {
		int num = 0;
		int sum = C;
		for (int i = 0; i < a.length; i++) {
			sum += a[i] * b[i];

		}
		if (sum > 0)
			num = 1;
		return num;
	} int num = 0; num 0 int sum = C; sum C for (int i = 0; i < a.length; i++) {
			sum += a[i] * b[i];

		} int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i {
			sum += a[i] * b[i];

		} {
			sum += a[i] * b[i];

		} sum += a[i] * b[i] sum a[i] * b[i] a[i] a i b[i] b i if (sum > 0)
			num = 1; sum > 0 sum 0 num = 1 num 1 return num; num int [] a a int [] b b int C C 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 [][] A = new int [N][M];
		int [] B = new int [M];
		
		for ( int j = 0; j < M; j++) {
			B[j] = sc.nextInt();
		}
		
		for ( int i = 0; i < N; i++) {
			for ( int j = 0; j < M; j++) {
				A[i][j] = sc.nextInt();
			}
		}
		
		int result = 0; 
		int count;
		for ( int i = 0; i < N; i++) {
			result += X(A[i], B, C);
		}
		
		System.out.println(result);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int C = sc.nextInt();
		
		int [][] A = new int [N][M];
		int [] B = new int [M];
		
		for ( int j = 0; j < M; j++) {
			B[j] = sc.nextInt();
		}
		
		for ( int i = 0; i < N; i++) {
			for ( int j = 0; j < M; j++) {
				A[i][j] = sc.nextInt();
			}
		}
		
		int result = 0; 
		int count;
		for ( int i = 0; i < N; i++) {
			result += X(A[i], B, C);
		}
		
		System.out.println(result);
	} 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 [][] A = new int [N][M]; A new int [N][M] N M int [] B = new int [M]; B new int [M] M for ( int j = 0; j < M; j++) {
			B[j] = sc.nextInt();
		} int j = 0; int j = 0; j 0 j < M j M j++ j++ j {
			B[j] = sc.nextInt();
		} {
			B[j] = sc.nextInt();
		} B[j] = sc.nextInt() B[j] B j sc.nextInt() sc.nextInt sc for ( int i = 0; i < N; i++) {
			for ( int j = 0; j < M; j++) {
				A[i][j] = sc.nextInt();
			}
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			for ( int j = 0; j < M; j++) {
				A[i][j] = sc.nextInt();
			}
		} {
			for ( int j = 0; j < M; j++) {
				A[i][j] = sc.nextInt();
			}
		} for ( int j = 0; j < M; j++) {
				A[i][j] = sc.nextInt();
			} int j = 0; int j = 0; j 0 j < M j M j++ j++ j {
				A[i][j] = sc.nextInt();
			} {
				A[i][j] = sc.nextInt();
			} A[i][j] = sc.nextInt() A[i][j] A[i] A i j sc.nextInt() sc.nextInt sc int result = 0; result 0 int count; count for ( int i = 0; i < N; i++) {
			result += X(A[i], B, C);
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			result += X(A[i], B, C);
		} {
			result += X(A[i], B, C);
		} result += X(A[i], B, C) result X(A[i], B, C) X A[i] A i B C System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

	private static int X(int [] a, int [] b, int C) {
		int num = 0;
		int sum = C;
		for (int i = 0; i < a.length; i++) {
			sum += a[i] * b[i];

		}
		if (sum > 0)
			num = 1;
		return num;
	}
	
	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 [][] A = new int [N][M];
		int [] B = new int [M];
		
		for ( int j = 0; j < M; j++) {
			B[j] = sc.nextInt();
		}
		
		for ( int i = 0; i < N; i++) {
			for ( int j = 0; j < M; j++) {
				A[i][j] = sc.nextInt();
			}
		}
		
		int result = 0; 
		int count;
		for ( int i = 0; i < N; i++) {
			result += X(A[i], B, C);
		}
		
		System.out.println(result);
	}

} public class Main {

	private static int X(int [] a, int [] b, int C) {
		int num = 0;
		int sum = C;
		for (int i = 0; i < a.length; i++) {
			sum += a[i] * b[i];

		}
		if (sum > 0)
			num = 1;
		return num;
	}
	
	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 [][] A = new int [N][M];
		int [] B = new int [M];
		
		for ( int j = 0; j < M; j++) {
			B[j] = sc.nextInt();
		}
		
		for ( int i = 0; i < N; i++) {
			for ( int j = 0; j < M; j++) {
				A[i][j] = sc.nextInt();
			}
		}
		
		int result = 0; 
		int count;
		for ( int i = 0; i < N; i++) {
			result += X(A[i], B, C);
		}
		
		System.out.println(result);
	}

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

	private static int X(int [] a, int [] b, int C) {
		int num = 0;
		int sum = C;
		for (int i = 0; i < a.length; i++) {
			sum += a[i] * b[i];

		}
		if (sum > 0)
			num = 1;
		return num;
	}
	
	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 [][] A = new int [N][M];
		int [] B = new int [M];
		
		for ( int j = 0; j < M; j++) {
			B[j] = sc.nextInt();
		}
		
		for ( int i = 0; i < N; i++) {
			for ( int j = 0; j < M; j++) {
				A[i][j] = sc.nextInt();
			}
		}
		
		int result = 0; 
		int count;
		for ( int i = 0; i < N; i++) {
			result += X(A[i], B, C);
		}
		
		System.out.println(result);
	}

}
