import java.io.*;
import java.util.Scanner;


public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int n = sc.nextInt();
		int m = sc.nextInt();
		int c = sc.nextInt();

		int[] b = new int[m];
		for (int i = 0; i < m; i++) {
			b[i] = sc.nextInt();
		}
		
		int[][] a = new int[n][m];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				a[i][j] = sc.nextInt();
			}
		}

		int cnt = 0;
		for (int i = 0; i < n; i++) {
			long tmp = c;
			for (int j = 0; j < m; j++) {
				tmp += a[i][j] * b[j];
			}
			
			if (tmp > 0) {
				cnt++;
			}
		}

		pr.println(cnt);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);
			
		solve();
			
		pr.close();
		sc.close();
	}

	static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
} import java.io.*; io.* java import java.util.Scanner; Scanner java.util public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int n = sc.nextInt();
		int m = sc.nextInt();
		int c = sc.nextInt();

		int[] b = new int[m];
		for (int i = 0; i < m; i++) {
			b[i] = sc.nextInt();
		}
		
		int[][] a = new int[n][m];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				a[i][j] = sc.nextInt();
			}
		}

		int cnt = 0;
		for (int i = 0; i < n; i++) {
			long tmp = c;
			for (int j = 0; j < m; j++) {
				tmp += a[i][j] * b[j];
			}
			
			if (tmp > 0) {
				cnt++;
			}
		}

		pr.println(cnt);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);
			
		solve();
			
		pr.close();
		sc.close();
	}

	static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
} Main private static Scanner sc; sc private static Printer pr; pr private static void solve() {
		int n = sc.nextInt();
		int m = sc.nextInt();
		int c = sc.nextInt();

		int[] b = new int[m];
		for (int i = 0; i < m; i++) {
			b[i] = sc.nextInt();
		}
		
		int[][] a = new int[n][m];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				a[i][j] = sc.nextInt();
			}
		}

		int cnt = 0;
		for (int i = 0; i < n; i++) {
			long tmp = c;
			for (int j = 0; j < m; j++) {
				tmp += a[i][j] * b[j];
			}
			
			if (tmp > 0) {
				cnt++;
			}
		}

		pr.println(cnt);
	} solve {
		int n = sc.nextInt();
		int m = sc.nextInt();
		int c = sc.nextInt();

		int[] b = new int[m];
		for (int i = 0; i < m; i++) {
			b[i] = sc.nextInt();
		}
		
		int[][] a = new int[n][m];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				a[i][j] = sc.nextInt();
			}
		}

		int cnt = 0;
		for (int i = 0; i < n; i++) {
			long tmp = c;
			for (int j = 0; j < m; j++) {
				tmp += a[i][j] * b[j];
			}
			
			if (tmp > 0) {
				cnt++;
			}
		}

		pr.println(cnt);
	} 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 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 int[][] a = new int[n][m]; a new int[n][m] n m 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 cnt = 0; cnt 0 for (int i = 0; i < n; i++) {
			long tmp = c;
			for (int j = 0; j < m; j++) {
				tmp += a[i][j] * b[j];
			}
			
			if (tmp > 0) {
				cnt++;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			long tmp = c;
			for (int j = 0; j < m; j++) {
				tmp += a[i][j] * b[j];
			}
			
			if (tmp > 0) {
				cnt++;
			}
		} {
			long tmp = c;
			for (int j = 0; j < m; j++) {
				tmp += a[i][j] * b[j];
			}
			
			if (tmp > 0) {
				cnt++;
			}
		} long tmp = c; tmp c for (int j = 0; j < m; j++) {
				tmp += a[i][j] * b[j];
			} int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
				tmp += a[i][j] * b[j];
			} {
				tmp += a[i][j] * b[j];
			} tmp += a[i][j] * b[j] tmp a[i][j] * b[j] a[i][j] a[i] a i j b[j] b j if (tmp > 0) {
				cnt++;
			} tmp > 0 tmp 0 {
				cnt++;
			} cnt++ cnt pr.println(cnt) pr.println pr cnt // ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);
			
		solve();
			
		pr.close();
		sc.close();
	} main {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);
			
		solve();
			
		pr.close();
		sc.close();
	} sc = new Scanner(System.in) sc new Scanner(System.in) pr = new Printer(System.out) pr new Printer(System.out) solve() solve pr.close() pr.close pr sc.close() sc.close sc String[] args args static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	} Printer Printer(OutputStream out) {
			super(out);
		} Printer {
			super(out);
		} super(out) super out OutputStream out out PrintWriter public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int n = sc.nextInt();
		int m = sc.nextInt();
		int c = sc.nextInt();

		int[] b = new int[m];
		for (int i = 0; i < m; i++) {
			b[i] = sc.nextInt();
		}
		
		int[][] a = new int[n][m];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				a[i][j] = sc.nextInt();
			}
		}

		int cnt = 0;
		for (int i = 0; i < n; i++) {
			long tmp = c;
			for (int j = 0; j < m; j++) {
				tmp += a[i][j] * b[j];
			}
			
			if (tmp > 0) {
				cnt++;
			}
		}

		pr.println(cnt);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);
			
		solve();
			
		pr.close();
		sc.close();
	}

	static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
} public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int n = sc.nextInt();
		int m = sc.nextInt();
		int c = sc.nextInt();

		int[] b = new int[m];
		for (int i = 0; i < m; i++) {
			b[i] = sc.nextInt();
		}
		
		int[][] a = new int[n][m];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				a[i][j] = sc.nextInt();
			}
		}

		int cnt = 0;
		for (int i = 0; i < n; i++) {
			long tmp = c;
			for (int j = 0; j < m; j++) {
				tmp += a[i][j] * b[j];
			}
			
			if (tmp > 0) {
				cnt++;
			}
		}

		pr.println(cnt);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);
			
		solve();
			
		pr.close();
		sc.close();
	}

	static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
} Main
import java.io.*;
import java.util.Scanner;


public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int n = sc.nextInt();
		int m = sc.nextInt();
		int c = sc.nextInt();

		int[] b = new int[m];
		for (int i = 0; i < m; i++) {
			b[i] = sc.nextInt();
		}
		
		int[][] a = new int[n][m];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				a[i][j] = sc.nextInt();
			}
		}

		int cnt = 0;
		for (int i = 0; i < n; i++) {
			long tmp = c;
			for (int j = 0; j < m; j++) {
				tmp += a[i][j] * b[j];
			}
			
			if (tmp > 0) {
				cnt++;
			}
		}

		pr.println(cnt);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);
			
		solve();
			
		pr.close();
		sc.close();
	}

	static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
}
