import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		final Scanner scanner = new Scanner(System.in);
		final int numOfSorceCodes = scanner.nextInt();
		final int features = scanner.nextInt();
		final int constatnt = scanner.nextInt();

		final int[] feature = new int[features];
		for (int i = 0; i < features; i++) {
			feature[i] = scanner.nextInt();
		}

		int result = 0;
		for (int i = 0; i < numOfSorceCodes; i++) {
			final int[] sourceCodeFeature = new int[features];
			for (int j = 0; j < features; j++) {
				sourceCodeFeature[j] = scanner.nextInt();
			}

			int tmp = 0;
			for (int j = 0; j < features; j++) {
				tmp += feature[j] * sourceCodeFeature[j];
			}

			if (tmp + constatnt > 0) {
				result++;
			}

		}
		System.out.println(result);
		scanner.close();
	}

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

	public static void main(String[] args) {
		final Scanner scanner = new Scanner(System.in);
		final int numOfSorceCodes = scanner.nextInt();
		final int features = scanner.nextInt();
		final int constatnt = scanner.nextInt();

		final int[] feature = new int[features];
		for (int i = 0; i < features; i++) {
			feature[i] = scanner.nextInt();
		}

		int result = 0;
		for (int i = 0; i < numOfSorceCodes; i++) {
			final int[] sourceCodeFeature = new int[features];
			for (int j = 0; j < features; j++) {
				sourceCodeFeature[j] = scanner.nextInt();
			}

			int tmp = 0;
			for (int j = 0; j < features; j++) {
				tmp += feature[j] * sourceCodeFeature[j];
			}

			if (tmp + constatnt > 0) {
				result++;
			}

		}
		System.out.println(result);
		scanner.close();
	}

} Main public static void main(String[] args) {
		final Scanner scanner = new Scanner(System.in);
		final int numOfSorceCodes = scanner.nextInt();
		final int features = scanner.nextInt();
		final int constatnt = scanner.nextInt();

		final int[] feature = new int[features];
		for (int i = 0; i < features; i++) {
			feature[i] = scanner.nextInt();
		}

		int result = 0;
		for (int i = 0; i < numOfSorceCodes; i++) {
			final int[] sourceCodeFeature = new int[features];
			for (int j = 0; j < features; j++) {
				sourceCodeFeature[j] = scanner.nextInt();
			}

			int tmp = 0;
			for (int j = 0; j < features; j++) {
				tmp += feature[j] * sourceCodeFeature[j];
			}

			if (tmp + constatnt > 0) {
				result++;
			}

		}
		System.out.println(result);
		scanner.close();
	} main {
		final Scanner scanner = new Scanner(System.in);
		final int numOfSorceCodes = scanner.nextInt();
		final int features = scanner.nextInt();
		final int constatnt = scanner.nextInt();

		final int[] feature = new int[features];
		for (int i = 0; i < features; i++) {
			feature[i] = scanner.nextInt();
		}

		int result = 0;
		for (int i = 0; i < numOfSorceCodes; i++) {
			final int[] sourceCodeFeature = new int[features];
			for (int j = 0; j < features; j++) {
				sourceCodeFeature[j] = scanner.nextInt();
			}

			int tmp = 0;
			for (int j = 0; j < features; j++) {
				tmp += feature[j] * sourceCodeFeature[j];
			}

			if (tmp + constatnt > 0) {
				result++;
			}

		}
		System.out.println(result);
		scanner.close();
	} final Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) final int numOfSorceCodes = scanner.nextInt(); numOfSorceCodes scanner.nextInt() scanner.nextInt scanner final int features = scanner.nextInt(); features scanner.nextInt() scanner.nextInt scanner final int constatnt = scanner.nextInt(); constatnt scanner.nextInt() scanner.nextInt scanner final int[] feature = new int[features]; feature new int[features] features for (int i = 0; i < features; i++) {
			feature[i] = scanner.nextInt();
		} int i = 0; int i = 0; i 0 i < features i features i++ i++ i {
			feature[i] = scanner.nextInt();
		} {
			feature[i] = scanner.nextInt();
		} feature[i] = scanner.nextInt() feature[i] feature i scanner.nextInt() scanner.nextInt scanner int result = 0; result 0 for (int i = 0; i < numOfSorceCodes; i++) {
			final int[] sourceCodeFeature = new int[features];
			for (int j = 0; j < features; j++) {
				sourceCodeFeature[j] = scanner.nextInt();
			}

			int tmp = 0;
			for (int j = 0; j < features; j++) {
				tmp += feature[j] * sourceCodeFeature[j];
			}

			if (tmp + constatnt > 0) {
				result++;
			}

		} int i = 0; int i = 0; i 0 i < numOfSorceCodes i numOfSorceCodes i++ i++ i {
			final int[] sourceCodeFeature = new int[features];
			for (int j = 0; j < features; j++) {
				sourceCodeFeature[j] = scanner.nextInt();
			}

			int tmp = 0;
			for (int j = 0; j < features; j++) {
				tmp += feature[j] * sourceCodeFeature[j];
			}

			if (tmp + constatnt > 0) {
				result++;
			}

		} {
			final int[] sourceCodeFeature = new int[features];
			for (int j = 0; j < features; j++) {
				sourceCodeFeature[j] = scanner.nextInt();
			}

			int tmp = 0;
			for (int j = 0; j < features; j++) {
				tmp += feature[j] * sourceCodeFeature[j];
			}

			if (tmp + constatnt > 0) {
				result++;
			}

		} final int[] sourceCodeFeature = new int[features]; sourceCodeFeature new int[features] features for (int j = 0; j < features; j++) {
				sourceCodeFeature[j] = scanner.nextInt();
			} int j = 0; int j = 0; j 0 j < features j features j++ j++ j {
				sourceCodeFeature[j] = scanner.nextInt();
			} {
				sourceCodeFeature[j] = scanner.nextInt();
			} sourceCodeFeature[j] = scanner.nextInt() sourceCodeFeature[j] sourceCodeFeature j scanner.nextInt() scanner.nextInt scanner int tmp = 0; tmp 0 for (int j = 0; j < features; j++) {
				tmp += feature[j] * sourceCodeFeature[j];
			} int j = 0; int j = 0; j 0 j < features j features j++ j++ j {
				tmp += feature[j] * sourceCodeFeature[j];
			} {
				tmp += feature[j] * sourceCodeFeature[j];
			} tmp += feature[j] * sourceCodeFeature[j] tmp feature[j] * sourceCodeFeature[j] feature[j] feature j sourceCodeFeature[j] sourceCodeFeature j if (tmp + constatnt > 0) {
				result++;
			} tmp + constatnt > 0 tmp + constatnt tmp constatnt 0 {
				result++;
			} result++ result System.out.println(result) System.out.println System.out System System.out result scanner.close() scanner.close scanner String[] args args public class Main {

	public static void main(String[] args) {
		final Scanner scanner = new Scanner(System.in);
		final int numOfSorceCodes = scanner.nextInt();
		final int features = scanner.nextInt();
		final int constatnt = scanner.nextInt();

		final int[] feature = new int[features];
		for (int i = 0; i < features; i++) {
			feature[i] = scanner.nextInt();
		}

		int result = 0;
		for (int i = 0; i < numOfSorceCodes; i++) {
			final int[] sourceCodeFeature = new int[features];
			for (int j = 0; j < features; j++) {
				sourceCodeFeature[j] = scanner.nextInt();
			}

			int tmp = 0;
			for (int j = 0; j < features; j++) {
				tmp += feature[j] * sourceCodeFeature[j];
			}

			if (tmp + constatnt > 0) {
				result++;
			}

		}
		System.out.println(result);
		scanner.close();
	}

} public class Main {

	public static void main(String[] args) {
		final Scanner scanner = new Scanner(System.in);
		final int numOfSorceCodes = scanner.nextInt();
		final int features = scanner.nextInt();
		final int constatnt = scanner.nextInt();

		final int[] feature = new int[features];
		for (int i = 0; i < features; i++) {
			feature[i] = scanner.nextInt();
		}

		int result = 0;
		for (int i = 0; i < numOfSorceCodes; i++) {
			final int[] sourceCodeFeature = new int[features];
			for (int j = 0; j < features; j++) {
				sourceCodeFeature[j] = scanner.nextInt();
			}

			int tmp = 0;
			for (int j = 0; j < features; j++) {
				tmp += feature[j] * sourceCodeFeature[j];
			}

			if (tmp + constatnt > 0) {
				result++;
			}

		}
		System.out.println(result);
		scanner.close();
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		final Scanner scanner = new Scanner(System.in);
		final int numOfSorceCodes = scanner.nextInt();
		final int features = scanner.nextInt();
		final int constatnt = scanner.nextInt();

		final int[] feature = new int[features];
		for (int i = 0; i < features; i++) {
			feature[i] = scanner.nextInt();
		}

		int result = 0;
		for (int i = 0; i < numOfSorceCodes; i++) {
			final int[] sourceCodeFeature = new int[features];
			for (int j = 0; j < features; j++) {
				sourceCodeFeature[j] = scanner.nextInt();
			}

			int tmp = 0;
			for (int j = 0; j < features; j++) {
				tmp += feature[j] * sourceCodeFeature[j];
			}

			if (tmp + constatnt > 0) {
				result++;
			}

		}
		System.out.println(result);
		scanner.close();
	}

}
