import java.util.Scanner;

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];
		for (int i = 0; i < m; i++) {
			b[i] = sc.nextInt();
		}
		for (int i = 0; i < n; i++) {
			for (int i2 = 0; i2 < m; i2++) {
				a[i][i2] = sc.nextInt();
			}
		}
		Solver s = new Solver(b, c);
		int ans = 0;
		for (int[] ai : a) {
			if (s.canSolve(ai)) {
				ans++;
			}
		}
		System.out.println(ans);
	}
	
}

class Solver {
	int[] b;
	int c;
	public Solver(int[] b, int c) {
		this.b = b;
		this.c = c;
	}
	boolean canSolve(int... a) {
		int value = c;
		for (int i = 0; i < b.length; i++) {
			value += a[i] * b[i];
		}
		return value > 0;
	}
} import java.util.Scanner; Scanner 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];
		for (int i = 0; i < m; i++) {
			b[i] = sc.nextInt();
		}
		for (int i = 0; i < n; i++) {
			for (int i2 = 0; i2 < m; i2++) {
				a[i][i2] = sc.nextInt();
			}
		}
		Solver s = new Solver(b, c);
		int ans = 0;
		for (int[] ai : a) {
			if (s.canSolve(ai)) {
				ans++;
			}
		}
		System.out.println(ans);
	}
	
} 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];
		for (int i = 0; i < m; i++) {
			b[i] = sc.nextInt();
		}
		for (int i = 0; i < n; i++) {
			for (int i2 = 0; i2 < m; i2++) {
				a[i][i2] = sc.nextInt();
			}
		}
		Solver s = new Solver(b, c);
		int ans = 0;
		for (int[] ai : a) {
			if (s.canSolve(ai)) {
				ans++;
			}
		}
		System.out.println(ans);
	} 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];
		for (int i = 0; i < m; i++) {
			b[i] = sc.nextInt();
		}
		for (int i = 0; i < n; i++) {
			for (int i2 = 0; i2 < m; i2++) {
				a[i][i2] = sc.nextInt();
			}
		}
		Solver s = new Solver(b, c);
		int ans = 0;
		for (int[] ai : a) {
			if (s.canSolve(ai)) {
				ans++;
			}
		}
		System.out.println(ans);
	} 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 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++) {
			for (int i2 = 0; i2 < m; i2++) {
				a[i][i2] = sc.nextInt();
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			for (int i2 = 0; i2 < m; i2++) {
				a[i][i2] = sc.nextInt();
			}
		} {
			for (int i2 = 0; i2 < m; i2++) {
				a[i][i2] = sc.nextInt();
			}
		} for (int i2 = 0; i2 < m; i2++) {
				a[i][i2] = sc.nextInt();
			} int i2 = 0; int i2 = 0; i2 0 i2 < m i2 m i2++ i2++ i2 {
				a[i][i2] = sc.nextInt();
			} {
				a[i][i2] = sc.nextInt();
			} a[i][i2] = sc.nextInt() a[i][i2] a[i] a i i2 sc.nextInt() sc.nextInt sc Solver s = new Solver(b, c); s new Solver(b, c) int ans = 0; ans 0 for (int[] ai : a) {
			if (s.canSolve(ai)) {
				ans++;
			}
		} int[] ai a {
			if (s.canSolve(ai)) {
				ans++;
			}
		} {
			if (s.canSolve(ai)) {
				ans++;
			}
		} if (s.canSolve(ai)) {
				ans++;
			} s.canSolve(ai) s.canSolve s ai {
				ans++;
			} ans++ ans System.out.println(ans) System.out.println System.out System System.out ans String[] args args class Solver {
	int[] b;
	int c;
	public Solver(int[] b, int c) {
		this.b = b;
		this.c = c;
	}
	boolean canSolve(int... a) {
		int value = c;
		for (int i = 0; i < b.length; i++) {
			value += a[i] * b[i];
		}
		return value > 0;
	}
} Solver int[] b; b int c; c public Solver(int[] b, int c) {
		this.b = b;
		this.c = c;
	} Solver {
		this.b = b;
		this.c = c;
	} this.b = b this.b this this.b b this.c = c this.c this this.c c int[] b b int c c boolean canSolve(int... a) {
		int value = c;
		for (int i = 0; i < b.length; i++) {
			value += a[i] * b[i];
		}
		return value > 0;
	} canSolve {
		int value = c;
		for (int i = 0; i < b.length; i++) {
			value += a[i] * b[i];
		}
		return value > 0;
	} int value = c; value c for (int i = 0; i < b.length; i++) {
			value += a[i] * b[i];
		} int i = 0; int i = 0; i 0 i < b.length i b.length b b.length i++ i++ i {
			value += a[i] * b[i];
		} {
			value += a[i] * b[i];
		} value += a[i] * b[i] value a[i] * b[i] a[i] a i b[i] b i return value > 0; value > 0 value 0 int... a a 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];
		for (int i = 0; i < m; i++) {
			b[i] = sc.nextInt();
		}
		for (int i = 0; i < n; i++) {
			for (int i2 = 0; i2 < m; i2++) {
				a[i][i2] = sc.nextInt();
			}
		}
		Solver s = new Solver(b, c);
		int ans = 0;
		for (int[] ai : a) {
			if (s.canSolve(ai)) {
				ans++;
			}
		}
		System.out.println(ans);
	}
	
} 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];
		for (int i = 0; i < m; i++) {
			b[i] = sc.nextInt();
		}
		for (int i = 0; i < n; i++) {
			for (int i2 = 0; i2 < m; i2++) {
				a[i][i2] = sc.nextInt();
			}
		}
		Solver s = new Solver(b, c);
		int ans = 0;
		for (int[] ai : a) {
			if (s.canSolve(ai)) {
				ans++;
			}
		}
		System.out.println(ans);
	}
	
} Main
import java.util.Scanner;

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];
		for (int i = 0; i < m; i++) {
			b[i] = sc.nextInt();
		}
		for (int i = 0; i < n; i++) {
			for (int i2 = 0; i2 < m; i2++) {
				a[i][i2] = sc.nextInt();
			}
		}
		Solver s = new Solver(b, c);
		int ans = 0;
		for (int[] ai : a) {
			if (s.canSolve(ai)) {
				ans++;
			}
		}
		System.out.println(ans);
	}
	
}

class Solver {
	int[] b;
	int c;
	public Solver(int[] b, int c) {
		this.b = b;
		this.c = c;
	}
	boolean canSolve(int... a) {
		int value = c;
		for (int i = 0; i < b.length; i++) {
			value += a[i] * b[i];
		}
		return value > 0;
	}
}
