
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int O = sc.nextInt();
        
        int[] L = new int[M];
        
        for(int i = 0 ; i < M ;i++) {
        	L[i] = sc.nextInt();
        }
        int count = 0;
        int judge = O;
        
        for(int i = 0 ; i < N ;i++) {
        	for(int m = 0 ; m < M;m++) {
        		judge += sc.nextInt()*L[m];
        	}
        	if(judge > 0) {
        		count++;
        	}
        		judge = O;
        	
        }
        System.out.println(count);
    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int O = sc.nextInt();
        
        int[] L = new int[M];
        
        for(int i = 0 ; i < M ;i++) {
        	L[i] = sc.nextInt();
        }
        int count = 0;
        int judge = O;
        
        for(int i = 0 ; i < N ;i++) {
        	for(int m = 0 ; m < M;m++) {
        		judge += sc.nextInt()*L[m];
        	}
        	if(judge > 0) {
        		count++;
        	}
        		judge = O;
        	
        }
        System.out.println(count);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int O = sc.nextInt();
        
        int[] L = new int[M];
        
        for(int i = 0 ; i < M ;i++) {
        	L[i] = sc.nextInt();
        }
        int count = 0;
        int judge = O;
        
        for(int i = 0 ; i < N ;i++) {
        	for(int m = 0 ; m < M;m++) {
        		judge += sc.nextInt()*L[m];
        	}
        	if(judge > 0) {
        		count++;
        	}
        		judge = O;
        	
        }
        System.out.println(count);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int O = sc.nextInt();
        
        int[] L = new int[M];
        
        for(int i = 0 ; i < M ;i++) {
        	L[i] = sc.nextInt();
        }
        int count = 0;
        int judge = O;
        
        for(int i = 0 ; i < N ;i++) {
        	for(int m = 0 ; m < M;m++) {
        		judge += sc.nextInt()*L[m];
        	}
        	if(judge > 0) {
        		count++;
        	}
        		judge = O;
        	
        }
        System.out.println(count);
    } 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 O = sc.nextInt(); O sc.nextInt() sc.nextInt sc int[] L = new int[M]; L new int[M] M for(int i = 0 ; i < M ;i++) {
        	L[i] = sc.nextInt();
        } int i = 0 ; int i = 0 ; i 0 i < M i M i++ i++ i {
        	L[i] = sc.nextInt();
        } {
        	L[i] = sc.nextInt();
        } L[i] = sc.nextInt() L[i] L i sc.nextInt() sc.nextInt sc int count = 0; count 0 int judge = O; judge O for(int i = 0 ; i < N ;i++) {
        	for(int m = 0 ; m < M;m++) {
        		judge += sc.nextInt()*L[m];
        	}
        	if(judge > 0) {
        		count++;
        	}
        		judge = O;
        	
        } int i = 0 ; int i = 0 ; i 0 i < N i N i++ i++ i {
        	for(int m = 0 ; m < M;m++) {
        		judge += sc.nextInt()*L[m];
        	}
        	if(judge > 0) {
        		count++;
        	}
        		judge = O;
        	
        } {
        	for(int m = 0 ; m < M;m++) {
        		judge += sc.nextInt()*L[m];
        	}
        	if(judge > 0) {
        		count++;
        	}
        		judge = O;
        	
        } for(int m = 0 ; m < M;m++) {
        		judge += sc.nextInt()*L[m];
        	} int m = 0 ; int m = 0 ; m 0 m < M m M m++ m++ m {
        		judge += sc.nextInt()*L[m];
        	} {
        		judge += sc.nextInt()*L[m];
        	} judge += sc.nextInt()*L[m] judge sc.nextInt()*L[m] sc.nextInt() sc.nextInt sc L[m] L m if(judge > 0) {
        		count++;
        	} judge > 0 judge 0 {
        		count++;
        	} count++ count judge = O judge O System.out.println(count) System.out.println System.out System System.out count String[] args args

import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int O = sc.nextInt();
        
        int[] L = new int[M];
        
        for(int i = 0 ; i < M ;i++) {
        	L[i] = sc.nextInt();
        }
        int count = 0;
        int judge = O;
        
        for(int i = 0 ; i < N ;i++) {
        	for(int m = 0 ; m < M;m++) {
        		judge += sc.nextInt()*L[m];
        	}
        	if(judge > 0) {
        		count++;
        	}
        		judge = O;
        	
        }
        System.out.println(count);
    }
}