

    import java.util.*;
    import java.io.*;
    class Program{
     
    }
    class Main{
        public static void main(String args[]) throws IOException{
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt(), count = 0,M = sc.nextInt(), C = sc.nextInt(),sum = C;
        int B[] = new int[M], A[] = new int[M];
        //System.out.println(N+" "+M+" "+C);
        for(int i = 0;i < M; i++) B[i] = sc.nextInt();
        for(int m = 0;m<N;m++){
            for(int i = 0; i<M;i++)A[i] = sc.nextInt();
            sum = C;
            for(int i = 0; i<M;i++)sum+=A[i]*B[i];
            if (sum>0) count++;
            }
        System.out.println(count);
        }
    } import java.util.*; util.* java import java.io.*; io.* java class Program{
     
    } Program class Main{
        public static void main(String args[]) throws IOException{
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt(), count = 0,M = sc.nextInt(), C = sc.nextInt(),sum = C;
        int B[] = new int[M], A[] = new int[M];
        //System.out.println(N+" "+M+" "+C);
        for(int i = 0;i < M; i++) B[i] = sc.nextInt();
        for(int m = 0;m<N;m++){
            for(int i = 0; i<M;i++)A[i] = sc.nextInt();
            sum = C;
            for(int i = 0; i<M;i++)sum+=A[i]*B[i];
            if (sum>0) count++;
            }
        System.out.println(count);
        }
    } Main public static void main(String args[]) throws IOException{
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt(), count = 0,M = sc.nextInt(), C = sc.nextInt(),sum = C;
        int B[] = new int[M], A[] = new int[M];
        //System.out.println(N+" "+M+" "+C);
        for(int i = 0;i < M; i++) B[i] = sc.nextInt();
        for(int m = 0;m<N;m++){
            for(int i = 0; i<M;i++)A[i] = sc.nextInt();
            sum = C;
            for(int i = 0; i<M;i++)sum+=A[i]*B[i];
            if (sum>0) count++;
            }
        System.out.println(count);
        } main {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt(), count = 0,M = sc.nextInt(), C = sc.nextInt(),sum = C;
        int B[] = new int[M], A[] = new int[M];
        //System.out.println(N+" "+M+" "+C);
        for(int i = 0;i < M; i++) B[i] = sc.nextInt();
        for(int m = 0;m<N;m++){
            for(int i = 0; i<M;i++)A[i] = sc.nextInt();
            sum = C;
            for(int i = 0; i<M;i++)sum+=A[i]*B[i];
            if (sum>0) count++;
            }
        System.out.println(count);
        } BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt() N sc.nextInt() sc.nextInt sc count = 0 count 0 M = sc.nextInt() M sc.nextInt() sc.nextInt sc C = sc.nextInt() C sc.nextInt() sc.nextInt sc sum = C; sum C int B[] = new int[M] B new int[M] M A[] = new int[M]; A 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] B i sc.nextInt() sc.nextInt sc for(int m = 0;m<N;m++){
            for(int i = 0; i<M;i++)A[i] = sc.nextInt();
            sum = C;
            for(int i = 0; i<M;i++)sum+=A[i]*B[i];
            if (sum>0) count++;
            } int m = 0; int m = 0; m 0 m<N m N m++ m++ m {
            for(int i = 0; i<M;i++)A[i] = sc.nextInt();
            sum = C;
            for(int i = 0; i<M;i++)sum+=A[i]*B[i];
            if (sum>0) count++;
            } {
            for(int i = 0; i<M;i++)A[i] = sc.nextInt();
            sum = C;
            for(int i = 0; i<M;i++)sum+=A[i]*B[i];
            if (sum>0) count++;
            } for(int i = 0; i<M;i++)A[i] = sc.nextInt(); int i = 0; int i = 0; i 0 i<M i M i++ i++ i A[i] = sc.nextInt(); A[i] = sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc sum = C sum C for(int i = 0; i<M;i++)sum+=A[i]*B[i]; int i = 0; int i = 0; i 0 i<M i M i++ i++ i sum+=A[i]*B[i]; sum+=A[i]*B[i] sum A[i]*B[i] A[i] A i B[i] B i if (sum>0) count++; sum>0 sum 0 count++ count System.out.println(count) System.out.println System.out System System.out count String args[] args


    import java.util.*;
    import java.io.*;
    class Program{
     
    }
    class Main{
        public static void main(String args[]) throws IOException{
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt(), count = 0,M = sc.nextInt(), C = sc.nextInt(),sum = C;
        int B[] = new int[M], A[] = new int[M];
        //System.out.println(N+" "+M+" "+C);
        for(int i = 0;i < M; i++) B[i] = sc.nextInt();
        for(int m = 0;m<N;m++){
            for(int i = 0; i<M;i++)A[i] = sc.nextInt();
            sum = C;
            for(int i = 0; i<M;i++)sum+=A[i]*B[i];
            if (sum>0) count++;
            }
        System.out.println(count);
        }
    }