import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int h = sc.nextInt();
		int r = sc.nextInt();
		int max = -sc.nextInt();
		int ans = 0;
		int[] row = new int[r];
		for (int i = 0; i < r; i++) {
			row[i] = sc.nextInt();
		}
		for (int i = 0; i < h; i++) {
			int sum = 0;
			for (int j = 0; j < r; j++) {
				sum = sum + sc.nextInt() * row[j];
			}
			if (sum > max) {
				ans++;
			}
		}
		System.out.println(ans);
		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int h = sc.nextInt();
		int r = sc.nextInt();
		int max = -sc.nextInt();
		int ans = 0;
		int[] row = new int[r];
		for (int i = 0; i < r; i++) {
			row[i] = sc.nextInt();
		}
		for (int i = 0; i < h; i++) {
			int sum = 0;
			for (int j = 0; j < r; j++) {
				sum = sum + sc.nextInt() * row[j];
			}
			if (sum > max) {
				ans++;
			}
		}
		System.out.println(ans);
		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int h = sc.nextInt();
		int r = sc.nextInt();
		int max = -sc.nextInt();
		int ans = 0;
		int[] row = new int[r];
		for (int i = 0; i < r; i++) {
			row[i] = sc.nextInt();
		}
		for (int i = 0; i < h; i++) {
			int sum = 0;
			for (int j = 0; j < r; j++) {
				sum = sum + sc.nextInt() * row[j];
			}
			if (sum > max) {
				ans++;
			}
		}
		System.out.println(ans);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int h = sc.nextInt();
		int r = sc.nextInt();
		int max = -sc.nextInt();
		int ans = 0;
		int[] row = new int[r];
		for (int i = 0; i < r; i++) {
			row[i] = sc.nextInt();
		}
		for (int i = 0; i < h; i++) {
			int sum = 0;
			for (int j = 0; j < r; j++) {
				sum = sum + sc.nextInt() * row[j];
			}
			if (sum > max) {
				ans++;
			}
		}
		System.out.println(ans);
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int h = sc.nextInt(); h sc.nextInt() sc.nextInt sc int r = sc.nextInt(); r sc.nextInt() sc.nextInt sc int max = -sc.nextInt(); max -sc.nextInt() sc.nextInt() sc.nextInt sc int ans = 0; ans 0 int[] row = new int[r]; row new int[r] r for (int i = 0; i < r; i++) {
			row[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < r i r i++ i++ i {
			row[i] = sc.nextInt();
		} {
			row[i] = sc.nextInt();
		} row[i] = sc.nextInt() row[i] row i sc.nextInt() sc.nextInt sc for (int i = 0; i < h; i++) {
			int sum = 0;
			for (int j = 0; j < r; j++) {
				sum = sum + sc.nextInt() * row[j];
			}
			if (sum > max) {
				ans++;
			}
		} int i = 0; int i = 0; i 0 i < h i h i++ i++ i {
			int sum = 0;
			for (int j = 0; j < r; j++) {
				sum = sum + sc.nextInt() * row[j];
			}
			if (sum > max) {
				ans++;
			}
		} {
			int sum = 0;
			for (int j = 0; j < r; j++) {
				sum = sum + sc.nextInt() * row[j];
			}
			if (sum > max) {
				ans++;
			}
		} int sum = 0; sum 0 for (int j = 0; j < r; j++) {
				sum = sum + sc.nextInt() * row[j];
			} int j = 0; int j = 0; j 0 j < r j r j++ j++ j {
				sum = sum + sc.nextInt() * row[j];
			} {
				sum = sum + sc.nextInt() * row[j];
			} sum = sum + sc.nextInt() * row[j] sum sum + sc.nextInt() * row[j] sum sc.nextInt() * row[j] sc.nextInt() sc.nextInt sc row[j] row j if (sum > max) {
				ans++;
			} sum > max sum max {
				ans++;
			} ans++ ans System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int h = sc.nextInt();
		int r = sc.nextInt();
		int max = -sc.nextInt();
		int ans = 0;
		int[] row = new int[r];
		for (int i = 0; i < r; i++) {
			row[i] = sc.nextInt();
		}
		for (int i = 0; i < h; i++) {
			int sum = 0;
			for (int j = 0; j < r; j++) {
				sum = sum + sc.nextInt() * row[j];
			}
			if (sum > max) {
				ans++;
			}
		}
		System.out.println(ans);
		sc.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int h = sc.nextInt();
		int r = sc.nextInt();
		int max = -sc.nextInt();
		int ans = 0;
		int[] row = new int[r];
		for (int i = 0; i < r; i++) {
			row[i] = sc.nextInt();
		}
		for (int i = 0; i < h; i++) {
			int sum = 0;
			for (int j = 0; j < r; j++) {
				sum = sum + sc.nextInt() * row[j];
			}
			if (sum > max) {
				ans++;
			}
		}
		System.out.println(ans);
		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int h = sc.nextInt();
		int r = sc.nextInt();
		int max = -sc.nextInt();
		int ans = 0;
		int[] row = new int[r];
		for (int i = 0; i < r; i++) {
			row[i] = sc.nextInt();
		}
		for (int i = 0; i < h; i++) {
			int sum = 0;
			for (int j = 0; j < r; j++) {
				sum = sum + sc.nextInt() * row[j];
			}
			if (sum > max) {
				ans++;
			}
		}
		System.out.println(ans);
		sc.close();
	}
}