import java.util.Scanner;
import java.util.Arrays;
import java.util.Calendar;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int M = scan.nextInt();
        int C = scan.nextInt();

        int B[] = new int[M];
        int A[] = new int[M];


        int total = 0;
        int count = 0;

        for(int i = 0 ; i < M; i++){
            B[i]= scan.nextInt();
        }

        for(int j = 0 ; j < N; j++){

        for(int i = 0 ; i < M; i++){
            A[i]= scan.nextInt();
            total += B[i] * A[i];
        }
        total += C;
        
        if(total > 0){
            count++;
        }
        total = 0;
        }
        System.out.println(count);
    }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util import java.util.Calendar; Calendar java.util public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int M = scan.nextInt();
        int C = scan.nextInt();

        int B[] = new int[M];
        int A[] = new int[M];


        int total = 0;
        int count = 0;

        for(int i = 0 ; i < M; i++){
            B[i]= scan.nextInt();
        }

        for(int j = 0 ; j < N; j++){

        for(int i = 0 ; i < M; i++){
            A[i]= scan.nextInt();
            total += B[i] * A[i];
        }
        total += C;
        
        if(total > 0){
            count++;
        }
        total = 0;
        }
        System.out.println(count);
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int M = scan.nextInt();
        int C = scan.nextInt();

        int B[] = new int[M];
        int A[] = new int[M];


        int total = 0;
        int count = 0;

        for(int i = 0 ; i < M; i++){
            B[i]= scan.nextInt();
        }

        for(int j = 0 ; j < N; j++){

        for(int i = 0 ; i < M; i++){
            A[i]= scan.nextInt();
            total += B[i] * A[i];
        }
        total += C;
        
        if(total > 0){
            count++;
        }
        total = 0;
        }
        System.out.println(count);
    } main {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int M = scan.nextInt();
        int C = scan.nextInt();

        int B[] = new int[M];
        int A[] = new int[M];


        int total = 0;
        int count = 0;

        for(int i = 0 ; i < M; i++){
            B[i]= scan.nextInt();
        }

        for(int j = 0 ; j < N; j++){

        for(int i = 0 ; i < M; i++){
            A[i]= scan.nextInt();
            total += B[i] * A[i];
        }
        total += C;
        
        if(total > 0){
            count++;
        }
        total = 0;
        }
        System.out.println(count);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan int M = scan.nextInt(); M scan.nextInt() scan.nextInt scan int C = scan.nextInt(); C scan.nextInt() scan.nextInt scan int B[] = new int[M]; B new int[M] M int A[] = new int[M]; A new int[M] M int total = 0; total 0 int count = 0; count 0 for(int i = 0 ; i < M; i++){
            B[i]= scan.nextInt();
        } int i = 0 ; int i = 0 ; i 0 i < M i M i++ i++ i {
            B[i]= scan.nextInt();
        } {
            B[i]= scan.nextInt();
        } B[i]= scan.nextInt() B[i] B i scan.nextInt() scan.nextInt scan for(int j = 0 ; j < N; j++){

        for(int i = 0 ; i < M; i++){
            A[i]= scan.nextInt();
            total += B[i] * A[i];
        }
        total += C;
        
        if(total > 0){
            count++;
        }
        total = 0;
        } int j = 0 ; int j = 0 ; j 0 j < N j N j++ j++ j {

        for(int i = 0 ; i < M; i++){
            A[i]= scan.nextInt();
            total += B[i] * A[i];
        }
        total += C;
        
        if(total > 0){
            count++;
        }
        total = 0;
        } {

        for(int i = 0 ; i < M; i++){
            A[i]= scan.nextInt();
            total += B[i] * A[i];
        }
        total += C;
        
        if(total > 0){
            count++;
        }
        total = 0;
        } for(int i = 0 ; i < M; i++){
            A[i]= scan.nextInt();
            total += B[i] * A[i];
        } int i = 0 ; int i = 0 ; i 0 i < M i M i++ i++ i {
            A[i]= scan.nextInt();
            total += B[i] * A[i];
        } {
            A[i]= scan.nextInt();
            total += B[i] * A[i];
        } A[i]= scan.nextInt() A[i] A i scan.nextInt() scan.nextInt scan total += B[i] * A[i] total B[i] * A[i] B[i] B i A[i] A i total += C total C if(total > 0){
            count++;
        } total > 0 total 0 {
            count++;
        } count++ count total = 0 total 0 System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int M = scan.nextInt();
        int C = scan.nextInt();

        int B[] = new int[M];
        int A[] = new int[M];


        int total = 0;
        int count = 0;

        for(int i = 0 ; i < M; i++){
            B[i]= scan.nextInt();
        }

        for(int j = 0 ; j < N; j++){

        for(int i = 0 ; i < M; i++){
            A[i]= scan.nextInt();
            total += B[i] * A[i];
        }
        total += C;
        
        if(total > 0){
            count++;
        }
        total = 0;
        }
        System.out.println(count);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int M = scan.nextInt();
        int C = scan.nextInt();

        int B[] = new int[M];
        int A[] = new int[M];


        int total = 0;
        int count = 0;

        for(int i = 0 ; i < M; i++){
            B[i]= scan.nextInt();
        }

        for(int j = 0 ; j < N; j++){

        for(int i = 0 ; i < M; i++){
            A[i]= scan.nextInt();
            total += B[i] * A[i];
        }
        total += C;
        
        if(total > 0){
            count++;
        }
        total = 0;
        }
        System.out.println(count);
    }
} Main
import java.util.Scanner;
import java.util.Arrays;
import java.util.Calendar;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int M = scan.nextInt();
        int C = scan.nextInt();

        int B[] = new int[M];
        int A[] = new int[M];


        int total = 0;
        int count = 0;

        for(int i = 0 ; i < M; i++){
            B[i]= scan.nextInt();
        }

        for(int j = 0 ; j < N; j++){

        for(int i = 0 ; i < M; i++){
            A[i]= scan.nextInt();
            total += B[i] * A[i];
        }
        total += C;
        
        if(total > 0){
            count++;
        }
        total = 0;
        }
        System.out.println(count);
    }
}