import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int numInt = sc.nextInt();
		int c = sc.nextInt();
		long get[] = new long[numInt];
		for(int i = 0; i < numInt; i ++) {
			get[i] = sc.nextLong();
		}
		long code[][] = new long[num][numInt];
		for(int i = 0; i < num; i ++) {
			for(int j = 0; j < numInt; j ++) {
				code[i][j] = sc.nextLong();
			}
		}
		int count = 0;
		for(int i = 0; i < num; i ++) {
			int tmp = c;
			for(int j = 0; j < numInt; j ++) {
				tmp += code[i][j] * get[j];
			}
			if(tmp > 0) { count ++; }
		}
		System.out.println(count);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int numInt = sc.nextInt();
		int c = sc.nextInt();
		long get[] = new long[numInt];
		for(int i = 0; i < numInt; i ++) {
			get[i] = sc.nextLong();
		}
		long code[][] = new long[num][numInt];
		for(int i = 0; i < num; i ++) {
			for(int j = 0; j < numInt; j ++) {
				code[i][j] = sc.nextLong();
			}
		}
		int count = 0;
		for(int i = 0; i < num; i ++) {
			int tmp = c;
			for(int j = 0; j < numInt; j ++) {
				tmp += code[i][j] * get[j];
			}
			if(tmp > 0) { count ++; }
		}
		System.out.println(count);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int numInt = sc.nextInt();
		int c = sc.nextInt();
		long get[] = new long[numInt];
		for(int i = 0; i < numInt; i ++) {
			get[i] = sc.nextLong();
		}
		long code[][] = new long[num][numInt];
		for(int i = 0; i < num; i ++) {
			for(int j = 0; j < numInt; j ++) {
				code[i][j] = sc.nextLong();
			}
		}
		int count = 0;
		for(int i = 0; i < num; i ++) {
			int tmp = c;
			for(int j = 0; j < numInt; j ++) {
				tmp += code[i][j] * get[j];
			}
			if(tmp > 0) { count ++; }
		}
		System.out.println(count);
	} main {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int numInt = sc.nextInt();
		int c = sc.nextInt();
		long get[] = new long[numInt];
		for(int i = 0; i < numInt; i ++) {
			get[i] = sc.nextLong();
		}
		long code[][] = new long[num][numInt];
		for(int i = 0; i < num; i ++) {
			for(int j = 0; j < numInt; j ++) {
				code[i][j] = sc.nextLong();
			}
		}
		int count = 0;
		for(int i = 0; i < num; i ++) {
			int tmp = c;
			for(int j = 0; j < numInt; j ++) {
				tmp += code[i][j] * get[j];
			}
			if(tmp > 0) { count ++; }
		}
		System.out.println(count);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc int numInt = sc.nextInt(); numInt sc.nextInt() sc.nextInt sc int c = sc.nextInt(); c sc.nextInt() sc.nextInt sc long get[] = new long[numInt]; get new long[numInt] numInt for(int i = 0; i < numInt; i ++) {
			get[i] = sc.nextLong();
		} int i = 0; int i = 0; i 0 i < numInt i numInt i ++ i ++ i {
			get[i] = sc.nextLong();
		} {
			get[i] = sc.nextLong();
		} get[i] = sc.nextLong() get[i] get i sc.nextLong() sc.nextLong sc long code[][] = new long[num][numInt]; code new long[num][numInt] num numInt for(int i = 0; i < num; i ++) {
			for(int j = 0; j < numInt; j ++) {
				code[i][j] = sc.nextLong();
			}
		} int i = 0; int i = 0; i 0 i < num i num i ++ i ++ i {
			for(int j = 0; j < numInt; j ++) {
				code[i][j] = sc.nextLong();
			}
		} {
			for(int j = 0; j < numInt; j ++) {
				code[i][j] = sc.nextLong();
			}
		} for(int j = 0; j < numInt; j ++) {
				code[i][j] = sc.nextLong();
			} int j = 0; int j = 0; j 0 j < numInt j numInt j ++ j ++ j {
				code[i][j] = sc.nextLong();
			} {
				code[i][j] = sc.nextLong();
			} code[i][j] = sc.nextLong() code[i][j] code[i] code i j sc.nextLong() sc.nextLong sc int count = 0; count 0 for(int i = 0; i < num; i ++) {
			int tmp = c;
			for(int j = 0; j < numInt; j ++) {
				tmp += code[i][j] * get[j];
			}
			if(tmp > 0) { count ++; }
		} int i = 0; int i = 0; i 0 i < num i num i ++ i ++ i {
			int tmp = c;
			for(int j = 0; j < numInt; j ++) {
				tmp += code[i][j] * get[j];
			}
			if(tmp > 0) { count ++; }
		} {
			int tmp = c;
			for(int j = 0; j < numInt; j ++) {
				tmp += code[i][j] * get[j];
			}
			if(tmp > 0) { count ++; }
		} int tmp = c; tmp c for(int j = 0; j < numInt; j ++) {
				tmp += code[i][j] * get[j];
			} int j = 0; int j = 0; j 0 j < numInt j numInt j ++ j ++ j {
				tmp += code[i][j] * get[j];
			} {
				tmp += code[i][j] * get[j];
			} tmp += code[i][j] * get[j] tmp code[i][j] * get[j] code[i][j] code[i] code i j get[j] get j if(tmp > 0) { count ++; } tmp > 0 tmp 0 { count ++; } count ++ count 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 sc = new Scanner(System.in);
		int num = sc.nextInt();
		int numInt = sc.nextInt();
		int c = sc.nextInt();
		long get[] = new long[numInt];
		for(int i = 0; i < numInt; i ++) {
			get[i] = sc.nextLong();
		}
		long code[][] = new long[num][numInt];
		for(int i = 0; i < num; i ++) {
			for(int j = 0; j < numInt; j ++) {
				code[i][j] = sc.nextLong();
			}
		}
		int count = 0;
		for(int i = 0; i < num; i ++) {
			int tmp = c;
			for(int j = 0; j < numInt; j ++) {
				tmp += code[i][j] * get[j];
			}
			if(tmp > 0) { count ++; }
		}
		System.out.println(count);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int numInt = sc.nextInt();
		int c = sc.nextInt();
		long get[] = new long[numInt];
		for(int i = 0; i < numInt; i ++) {
			get[i] = sc.nextLong();
		}
		long code[][] = new long[num][numInt];
		for(int i = 0; i < num; i ++) {
			for(int j = 0; j < numInt; j ++) {
				code[i][j] = sc.nextLong();
			}
		}
		int count = 0;
		for(int i = 0; i < num; i ++) {
			int tmp = c;
			for(int j = 0; j < numInt; j ++) {
				tmp += code[i][j] * get[j];
			}
			if(tmp > 0) { count ++; }
		}
		System.out.println(count);
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int numInt = sc.nextInt();
		int c = sc.nextInt();
		long get[] = new long[numInt];
		for(int i = 0; i < numInt; i ++) {
			get[i] = sc.nextLong();
		}
		long code[][] = new long[num][numInt];
		for(int i = 0; i < num; i ++) {
			for(int j = 0; j < numInt; j ++) {
				code[i][j] = sc.nextLong();
			}
		}
		int count = 0;
		for(int i = 0; i < num; i ++) {
			int tmp = c;
			for(int j = 0; j < numInt; j ++) {
				tmp += code[i][j] * get[j];
			}
			if(tmp > 0) { count ++; }
		}
		System.out.println(count);
	}
}