import java.util.Scanner;

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

        int[] multiply = new int[M];
        for (int i = 0 ; i < M; i++)
            multiply[i] = sc.nextInt();
        int ans = 0;
        for (int i = 0 ; i < N; i++){
            long sum = 0;
            for (int j = 0 ; j < M ; j++){
                sum += (multiply[j] * sc.nextInt());
            }
            sum += C;
            if(sum > 0)
                ans ++;
        }
        System.out.println(ans);
        sc.close();
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int C = sc.nextInt();

        int[] multiply = new int[M];
        for (int i = 0 ; i < M; i++)
            multiply[i] = sc.nextInt();
        int ans = 0;
        for (int i = 0 ; i < N; i++){
            long sum = 0;
            for (int j = 0 ; j < M ; j++){
                sum += (multiply[j] * sc.nextInt());
            }
            sum += C;
            if(sum > 0)
                ans ++;
        }
        System.out.println(ans);
        sc.close();
    }
} Main public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int C = sc.nextInt();

        int[] multiply = new int[M];
        for (int i = 0 ; i < M; i++)
            multiply[i] = sc.nextInt();
        int ans = 0;
        for (int i = 0 ; i < N; i++){
            long sum = 0;
            for (int j = 0 ; j < M ; j++){
                sum += (multiply[j] * sc.nextInt());
            }
            sum += C;
            if(sum > 0)
                ans ++;
        }
        System.out.println(ans);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int C = sc.nextInt();

        int[] multiply = new int[M];
        for (int i = 0 ; i < M; i++)
            multiply[i] = sc.nextInt();
        int ans = 0;
        for (int i = 0 ; i < N; i++){
            long sum = 0;
            for (int j = 0 ; j < M ; j++){
                sum += (multiply[j] * sc.nextInt());
            }
            sum += C;
            if(sum > 0)
                ans ++;
        }
        System.out.println(ans);
        sc.close();
    } 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 C = sc.nextInt(); C sc.nextInt() sc.nextInt sc int[] multiply = new int[M]; multiply new int[M] M for (int i = 0 ; i < M; i++)
            multiply[i] = sc.nextInt(); int i = 0 ; int i = 0 ; i 0 i < M i M i++ i++ i multiply[i] = sc.nextInt(); multiply[i] = sc.nextInt() multiply[i] multiply i sc.nextInt() sc.nextInt sc int ans = 0; ans 0 for (int i = 0 ; i < N; i++){
            long sum = 0;
            for (int j = 0 ; j < M ; j++){
                sum += (multiply[j] * sc.nextInt());
            }
            sum += C;
            if(sum > 0)
                ans ++;
        } int i = 0 ; int i = 0 ; i 0 i < N i N i++ i++ i {
            long sum = 0;
            for (int j = 0 ; j < M ; j++){
                sum += (multiply[j] * sc.nextInt());
            }
            sum += C;
            if(sum > 0)
                ans ++;
        } {
            long sum = 0;
            for (int j = 0 ; j < M ; j++){
                sum += (multiply[j] * sc.nextInt());
            }
            sum += C;
            if(sum > 0)
                ans ++;
        } long sum = 0; sum 0 for (int j = 0 ; j < M ; j++){
                sum += (multiply[j] * sc.nextInt());
            } int j = 0 ; int j = 0 ; j 0 j < M j M j++ j++ j {
                sum += (multiply[j] * sc.nextInt());
            } {
                sum += (multiply[j] * sc.nextInt());
            } sum += (multiply[j] * sc.nextInt()) sum (multiply[j] * sc.nextInt()) multiply[j] multiply j sc.nextInt() sc.nextInt sc sum += C sum C if(sum > 0)
                ans ++; sum > 0 sum 0 ans ++ ans System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc String args[] args public class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int C = sc.nextInt();

        int[] multiply = new int[M];
        for (int i = 0 ; i < M; i++)
            multiply[i] = sc.nextInt();
        int ans = 0;
        for (int i = 0 ; i < N; i++){
            long sum = 0;
            for (int j = 0 ; j < M ; j++){
                sum += (multiply[j] * sc.nextInt());
            }
            sum += C;
            if(sum > 0)
                ans ++;
        }
        System.out.println(ans);
        sc.close();
    }
} public class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int C = sc.nextInt();

        int[] multiply = new int[M];
        for (int i = 0 ; i < M; i++)
            multiply[i] = sc.nextInt();
        int ans = 0;
        for (int i = 0 ; i < N; i++){
            long sum = 0;
            for (int j = 0 ; j < M ; j++){
                sum += (multiply[j] * sc.nextInt());
            }
            sum += C;
            if(sum > 0)
                ans ++;
        }
        System.out.println(ans);
        sc.close();
    }
} Main
import java.util.Scanner;

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

        int[] multiply = new int[M];
        for (int i = 0 ; i < M; i++)
            multiply[i] = sc.nextInt();
        int ans = 0;
        for (int i = 0 ; i < N; i++){
            long sum = 0;
            for (int j = 0 ; j < M ; j++){
                sum += (multiply[j] * sc.nextInt());
            }
            sum += C;
            if(sum > 0)
                ans ++;
        }
        System.out.println(ans);
        sc.close();
    }
}
