import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Main main = new Main();
		main.solve();
	}

	void solve() {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int[] B = new int[m];
		int[][] A = new int[n][m];
		for(int i=0;i<m;i++) {B[i] = Integer.parseInt(sc.next());}
		for(int i=0;i<n;i++) {
			for(int j=0;j<m;j++){
				A[i][j] = Integer.parseInt(sc.next());
			}
		}

		int cnt = 0;
		for(int i=0;i<n;i++) {
			long num = c;
			for(int j=0;j<m;j++) {
				num += A[i][j]*B[j];
			}
			if(num>0)cnt++;
		}
		System.out.println(cnt);
	}

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

	public static void main(String[] args) {
		Main main = new Main();
		main.solve();
	}

	void solve() {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int[] B = new int[m];
		int[][] A = new int[n][m];
		for(int i=0;i<m;i++) {B[i] = Integer.parseInt(sc.next());}
		for(int i=0;i<n;i++) {
			for(int j=0;j<m;j++){
				A[i][j] = Integer.parseInt(sc.next());
			}
		}

		int cnt = 0;
		for(int i=0;i<n;i++) {
			long num = c;
			for(int j=0;j<m;j++) {
				num += A[i][j]*B[j];
			}
			if(num>0)cnt++;
		}
		System.out.println(cnt);
	}

} Main public static void main(String[] args) {
		Main main = new Main();
		main.solve();
	} main {
		Main main = new Main();
		main.solve();
	} Main main = new Main(); main new Main() main.solve() main.solve main String[] args args void solve() {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int[] B = new int[m];
		int[][] A = new int[n][m];
		for(int i=0;i<m;i++) {B[i] = Integer.parseInt(sc.next());}
		for(int i=0;i<n;i++) {
			for(int j=0;j<m;j++){
				A[i][j] = Integer.parseInt(sc.next());
			}
		}

		int cnt = 0;
		for(int i=0;i<n;i++) {
			long num = c;
			for(int j=0;j<m;j++) {
				num += A[i][j]*B[j];
			}
			if(num>0)cnt++;
		}
		System.out.println(cnt);
	} solve {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int[] B = new int[m];
		int[][] A = new int[n][m];
		for(int i=0;i<m;i++) {B[i] = Integer.parseInt(sc.next());}
		for(int i=0;i<n;i++) {
			for(int j=0;j<m;j++){
				A[i][j] = Integer.parseInt(sc.next());
			}
		}

		int cnt = 0;
		for(int i=0;i<n;i++) {
			long num = c;
			for(int j=0;j<m;j++) {
				num += A[i][j]*B[j];
			}
			if(num>0)cnt++;
		}
		System.out.println(cnt);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int m = Integer.parseInt(sc.next()); m Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int c = Integer.parseInt(sc.next()); c Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next 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] = Integer.parseInt(sc.next());} int i=0; int i=0; i 0 i<m i m i++ i++ i {B[i] = Integer.parseInt(sc.next());} {B[i] = Integer.parseInt(sc.next());} B[i] = Integer.parseInt(sc.next()) B[i] B i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc for(int i=0;i<n;i++) {
			for(int j=0;j<m;j++){
				A[i][j] = Integer.parseInt(sc.next());
			}
		} 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] = Integer.parseInt(sc.next());
			}
		} {
			for(int j=0;j<m;j++){
				A[i][j] = Integer.parseInt(sc.next());
			}
		} for(int j=0;j<m;j++){
				A[i][j] = Integer.parseInt(sc.next());
			} int j=0; int j=0; j 0 j<m j m j++ j++ j {
				A[i][j] = Integer.parseInt(sc.next());
			} {
				A[i][j] = Integer.parseInt(sc.next());
			} A[i][j] = Integer.parseInt(sc.next()) A[i][j] A[i] A i j Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int cnt = 0; cnt 0 for(int i=0;i<n;i++) {
			long num = c;
			for(int j=0;j<m;j++) {
				num += A[i][j]*B[j];
			}
			if(num>0)cnt++;
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			long num = c;
			for(int j=0;j<m;j++) {
				num += A[i][j]*B[j];
			}
			if(num>0)cnt++;
		} {
			long num = c;
			for(int j=0;j<m;j++) {
				num += A[i][j]*B[j];
			}
			if(num>0)cnt++;
		} long num = c; num c for(int j=0;j<m;j++) {
				num += A[i][j]*B[j];
			} int j=0; int j=0; j 0 j<m j m j++ j++ j {
				num += A[i][j]*B[j];
			} {
				num += A[i][j]*B[j];
			} num += A[i][j]*B[j] num A[i][j]*B[j] A[i][j] A[i] A i j B[j] B j if(num>0)cnt++; num>0 num 0 cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt public class Main {

	public static void main(String[] args) {
		Main main = new Main();
		main.solve();
	}

	void solve() {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int[] B = new int[m];
		int[][] A = new int[n][m];
		for(int i=0;i<m;i++) {B[i] = Integer.parseInt(sc.next());}
		for(int i=0;i<n;i++) {
			for(int j=0;j<m;j++){
				A[i][j] = Integer.parseInt(sc.next());
			}
		}

		int cnt = 0;
		for(int i=0;i<n;i++) {
			long num = c;
			for(int j=0;j<m;j++) {
				num += A[i][j]*B[j];
			}
			if(num>0)cnt++;
		}
		System.out.println(cnt);
	}

} public class Main {

	public static void main(String[] args) {
		Main main = new Main();
		main.solve();
	}

	void solve() {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int[] B = new int[m];
		int[][] A = new int[n][m];
		for(int i=0;i<m;i++) {B[i] = Integer.parseInt(sc.next());}
		for(int i=0;i<n;i++) {
			for(int j=0;j<m;j++){
				A[i][j] = Integer.parseInt(sc.next());
			}
		}

		int cnt = 0;
		for(int i=0;i<n;i++) {
			long num = c;
			for(int j=0;j<m;j++) {
				num += A[i][j]*B[j];
			}
			if(num>0)cnt++;
		}
		System.out.println(cnt);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Main main = new Main();
		main.solve();
	}

	void solve() {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int[] B = new int[m];
		int[][] A = new int[n][m];
		for(int i=0;i<m;i++) {B[i] = Integer.parseInt(sc.next());}
		for(int i=0;i<n;i++) {
			for(int j=0;j<m;j++){
				A[i][j] = Integer.parseInt(sc.next());
			}
		}

		int cnt = 0;
		for(int i=0;i<n;i++) {
			long num = c;
			for(int j=0;j<m;j++) {
				num += A[i][j]*B[j];
			}
			if(num>0)cnt++;
		}
		System.out.println(cnt);
	}

}
