

import java.util.*;
import java.math.*;
import java.util.Scanner;
import java.math.BigInteger;

public class Main {
	static final long mod = (int) (1e9 + 7);
	static final int inf = (int) (1e9);
	static final int maxn = (int) (1e5 + 10);

	static int n, m,c;
	static String s;
	static int[][] a=new int [22][22];
	static int [] b=new int[22];
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		n=cin.nextInt();m=cin.nextInt();c=cin.nextInt();
		for(int i=1;i<=m;i++) {
			b[i]=cin.nextInt();
		}
		int sum=0,ans=0;
		for(int i=1;i<=n;i++) {
			sum=c;
			for(int j=1;j<=m;j++) {
				a[i][j]=cin.nextInt();
				sum+=a[i][j]*b[j];
			}
			if(sum>0) ans++;
		}
		System.out.println(ans);
	}
} import java.util.*; util.* java import java.math.*; math.* java import java.util.Scanner; Scanner java.util import java.math.BigInteger; BigInteger java.math public class Main {
	static final long mod = (int) (1e9 + 7);
	static final int inf = (int) (1e9);
	static final int maxn = (int) (1e5 + 10);

	static int n, m,c;
	static String s;
	static int[][] a=new int [22][22];
	static int [] b=new int[22];
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		n=cin.nextInt();m=cin.nextInt();c=cin.nextInt();
		for(int i=1;i<=m;i++) {
			b[i]=cin.nextInt();
		}
		int sum=0,ans=0;
		for(int i=1;i<=n;i++) {
			sum=c;
			for(int j=1;j<=m;j++) {
				a[i][j]=cin.nextInt();
				sum+=a[i][j]*b[j];
			}
			if(sum>0) ans++;
		}
		System.out.println(ans);
	}
} Main static final long mod = (int) (1e9 + 7); mod (int) (1e9 + 7) 1e9 7 static final int inf = (int) (1e9); inf (int) (1e9) static final int maxn = (int) (1e5 + 10); maxn (int) (1e5 + 10) 1e5 10 static int n n m m c; c static String s; s static int[][] a=new int [22][22]; a new int [22][22] 22 22 static int [] b=new int[22]; b new int[22] 22 public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		n=cin.nextInt();m=cin.nextInt();c=cin.nextInt();
		for(int i=1;i<=m;i++) {
			b[i]=cin.nextInt();
		}
		int sum=0,ans=0;
		for(int i=1;i<=n;i++) {
			sum=c;
			for(int j=1;j<=m;j++) {
				a[i][j]=cin.nextInt();
				sum+=a[i][j]*b[j];
			}
			if(sum>0) ans++;
		}
		System.out.println(ans);
	} main {
		Scanner cin = new Scanner(System.in);
		n=cin.nextInt();m=cin.nextInt();c=cin.nextInt();
		for(int i=1;i<=m;i++) {
			b[i]=cin.nextInt();
		}
		int sum=0,ans=0;
		for(int i=1;i<=n;i++) {
			sum=c;
			for(int j=1;j<=m;j++) {
				a[i][j]=cin.nextInt();
				sum+=a[i][j]*b[j];
			}
			if(sum>0) ans++;
		}
		System.out.println(ans);
	} Scanner cin = new Scanner(System.in); cin new Scanner(System.in) n=cin.nextInt() n cin.nextInt() cin.nextInt cin m=cin.nextInt() m cin.nextInt() cin.nextInt cin c=cin.nextInt() c cin.nextInt() cin.nextInt cin for(int i=1;i<=m;i++) {
			b[i]=cin.nextInt();
		} int i=1; int i=1; i 1 i<=m i m i++ i++ i {
			b[i]=cin.nextInt();
		} {
			b[i]=cin.nextInt();
		} b[i]=cin.nextInt() b[i] b i cin.nextInt() cin.nextInt cin int sum=0 sum 0 ans=0; ans 0 for(int i=1;i<=n;i++) {
			sum=c;
			for(int j=1;j<=m;j++) {
				a[i][j]=cin.nextInt();
				sum+=a[i][j]*b[j];
			}
			if(sum>0) ans++;
		} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
			sum=c;
			for(int j=1;j<=m;j++) {
				a[i][j]=cin.nextInt();
				sum+=a[i][j]*b[j];
			}
			if(sum>0) ans++;
		} {
			sum=c;
			for(int j=1;j<=m;j++) {
				a[i][j]=cin.nextInt();
				sum+=a[i][j]*b[j];
			}
			if(sum>0) ans++;
		} sum=c sum c for(int j=1;j<=m;j++) {
				a[i][j]=cin.nextInt();
				sum+=a[i][j]*b[j];
			} int j=1; int j=1; j 1 j<=m j m j++ j++ j {
				a[i][j]=cin.nextInt();
				sum+=a[i][j]*b[j];
			} {
				a[i][j]=cin.nextInt();
				sum+=a[i][j]*b[j];
			} a[i][j]=cin.nextInt() a[i][j] a[i] a i j cin.nextInt() cin.nextInt cin sum+=a[i][j]*b[j] sum a[i][j]*b[j] a[i][j] a[i] a i j b[j] b j if(sum>0) ans++; sum>0 sum 0 ans++ ans System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	static final long mod = (int) (1e9 + 7);
	static final int inf = (int) (1e9);
	static final int maxn = (int) (1e5 + 10);

	static int n, m,c;
	static String s;
	static int[][] a=new int [22][22];
	static int [] b=new int[22];
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		n=cin.nextInt();m=cin.nextInt();c=cin.nextInt();
		for(int i=1;i<=m;i++) {
			b[i]=cin.nextInt();
		}
		int sum=0,ans=0;
		for(int i=1;i<=n;i++) {
			sum=c;
			for(int j=1;j<=m;j++) {
				a[i][j]=cin.nextInt();
				sum+=a[i][j]*b[j];
			}
			if(sum>0) ans++;
		}
		System.out.println(ans);
	}
} public class Main {
	static final long mod = (int) (1e9 + 7);
	static final int inf = (int) (1e9);
	static final int maxn = (int) (1e5 + 10);

	static int n, m,c;
	static String s;
	static int[][] a=new int [22][22];
	static int [] b=new int[22];
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		n=cin.nextInt();m=cin.nextInt();c=cin.nextInt();
		for(int i=1;i<=m;i++) {
			b[i]=cin.nextInt();
		}
		int sum=0,ans=0;
		for(int i=1;i<=n;i++) {
			sum=c;
			for(int j=1;j<=m;j++) {
				a[i][j]=cin.nextInt();
				sum+=a[i][j]*b[j];
			}
			if(sum>0) ans++;
		}
		System.out.println(ans);
	}
} Main


import java.util.*;
import java.math.*;
import java.util.Scanner;
import java.math.BigInteger;

public class Main {
	static final long mod = (int) (1e9 + 7);
	static final int inf = (int) (1e9);
	static final int maxn = (int) (1e5 + 10);

	static int n, m,c;
	static String s;
	static int[][] a=new int [22][22];
	static int [] b=new int[22];
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		n=cin.nextInt();m=cin.nextInt();c=cin.nextInt();
		for(int i=1;i<=m;i++) {
			b[i]=cin.nextInt();
		}
		int sum=0,ans=0;
		for(int i=1;i<=n;i++) {
			sum=c;
			for(int j=1;j<=m;j++) {
				a[i][j]=cin.nextInt();
				sum+=a[i][j]*b[j];
			}
			if(sum>0) ans++;
		}
		System.out.println(ans);
	}
}