import java.text.SimpleDateFormat;
import java.util.*;

public class Main {


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Map<String,Integer> map = new HashMap<String,Integer>();

        String temp = sc.nextLine();

        String[] tempArr = temp.split(" ");

        int N = Integer.parseInt(tempArr[0]);
        int M = Integer.parseInt(tempArr[1]);
        int C = Integer.parseInt(tempArr[2]);

        int[] MList = new int[M];

        temp = sc.nextLine();
        tempArr = temp.split(" ");
        for (int j = 0; j < M; j++) {
            MList[j] = Integer.parseInt(tempArr[j]);
        }

        int sum = 0;
        int counter = 0;
        for (int i = 0; i < N; i++) {
            temp = sc.nextLine();
            tempArr = temp.split(" ");
            sum = 0;
            for (int j = 0; j < M; j++) {
                sum += Integer.parseInt(tempArr[j]) * MList[j];
            }
            if ((sum + C) > 0) {
                counter++;
            }
        }

        System.out.println(counter);





    }

} import java.text.SimpleDateFormat; SimpleDateFormat java.text import java.util.*; util.* java public class Main {


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Map<String,Integer> map = new HashMap<String,Integer>();

        String temp = sc.nextLine();

        String[] tempArr = temp.split(" ");

        int N = Integer.parseInt(tempArr[0]);
        int M = Integer.parseInt(tempArr[1]);
        int C = Integer.parseInt(tempArr[2]);

        int[] MList = new int[M];

        temp = sc.nextLine();
        tempArr = temp.split(" ");
        for (int j = 0; j < M; j++) {
            MList[j] = Integer.parseInt(tempArr[j]);
        }

        int sum = 0;
        int counter = 0;
        for (int i = 0; i < N; i++) {
            temp = sc.nextLine();
            tempArr = temp.split(" ");
            sum = 0;
            for (int j = 0; j < M; j++) {
                sum += Integer.parseInt(tempArr[j]) * MList[j];
            }
            if ((sum + C) > 0) {
                counter++;
            }
        }

        System.out.println(counter);





    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Map<String,Integer> map = new HashMap<String,Integer>();

        String temp = sc.nextLine();

        String[] tempArr = temp.split(" ");

        int N = Integer.parseInt(tempArr[0]);
        int M = Integer.parseInt(tempArr[1]);
        int C = Integer.parseInt(tempArr[2]);

        int[] MList = new int[M];

        temp = sc.nextLine();
        tempArr = temp.split(" ");
        for (int j = 0; j < M; j++) {
            MList[j] = Integer.parseInt(tempArr[j]);
        }

        int sum = 0;
        int counter = 0;
        for (int i = 0; i < N; i++) {
            temp = sc.nextLine();
            tempArr = temp.split(" ");
            sum = 0;
            for (int j = 0; j < M; j++) {
                sum += Integer.parseInt(tempArr[j]) * MList[j];
            }
            if ((sum + C) > 0) {
                counter++;
            }
        }

        System.out.println(counter);





    } main {
        Scanner sc = new Scanner(System.in);
        Map<String,Integer> map = new HashMap<String,Integer>();

        String temp = sc.nextLine();

        String[] tempArr = temp.split(" ");

        int N = Integer.parseInt(tempArr[0]);
        int M = Integer.parseInt(tempArr[1]);
        int C = Integer.parseInt(tempArr[2]);

        int[] MList = new int[M];

        temp = sc.nextLine();
        tempArr = temp.split(" ");
        for (int j = 0; j < M; j++) {
            MList[j] = Integer.parseInt(tempArr[j]);
        }

        int sum = 0;
        int counter = 0;
        for (int i = 0; i < N; i++) {
            temp = sc.nextLine();
            tempArr = temp.split(" ");
            sum = 0;
            for (int j = 0; j < M; j++) {
                sum += Integer.parseInt(tempArr[j]) * MList[j];
            }
            if ((sum + C) > 0) {
                counter++;
            }
        }

        System.out.println(counter);





    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) Map<String,Integer> map = new HashMap<String,Integer>(); map new HashMap<String,Integer>() String temp = sc.nextLine(); temp sc.nextLine() sc.nextLine sc String[] tempArr = temp.split(" "); tempArr temp.split(" ") temp.split temp " " int N = Integer.parseInt(tempArr[0]); N Integer.parseInt(tempArr[0]) Integer.parseInt Integer tempArr[0] tempArr 0 int M = Integer.parseInt(tempArr[1]); M Integer.parseInt(tempArr[1]) Integer.parseInt Integer tempArr[1] tempArr 1 int C = Integer.parseInt(tempArr[2]); C Integer.parseInt(tempArr[2]) Integer.parseInt Integer tempArr[2] tempArr 2 int[] MList = new int[M]; MList new int[M] M temp = sc.nextLine() temp sc.nextLine() sc.nextLine sc tempArr = temp.split(" ") tempArr temp.split(" ") temp.split temp " " for (int j = 0; j < M; j++) {
            MList[j] = Integer.parseInt(tempArr[j]);
        } int j = 0; int j = 0; j 0 j < M j M j++ j++ j {
            MList[j] = Integer.parseInt(tempArr[j]);
        } {
            MList[j] = Integer.parseInt(tempArr[j]);
        } MList[j] = Integer.parseInt(tempArr[j]) MList[j] MList j Integer.parseInt(tempArr[j]) Integer.parseInt Integer tempArr[j] tempArr j int sum = 0; sum 0 int counter = 0; counter 0 for (int i = 0; i < N; i++) {
            temp = sc.nextLine();
            tempArr = temp.split(" ");
            sum = 0;
            for (int j = 0; j < M; j++) {
                sum += Integer.parseInt(tempArr[j]) * MList[j];
            }
            if ((sum + C) > 0) {
                counter++;
            }
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            temp = sc.nextLine();
            tempArr = temp.split(" ");
            sum = 0;
            for (int j = 0; j < M; j++) {
                sum += Integer.parseInt(tempArr[j]) * MList[j];
            }
            if ((sum + C) > 0) {
                counter++;
            }
        } {
            temp = sc.nextLine();
            tempArr = temp.split(" ");
            sum = 0;
            for (int j = 0; j < M; j++) {
                sum += Integer.parseInt(tempArr[j]) * MList[j];
            }
            if ((sum + C) > 0) {
                counter++;
            }
        } temp = sc.nextLine() temp sc.nextLine() sc.nextLine sc tempArr = temp.split(" ") tempArr temp.split(" ") temp.split temp " " sum = 0 sum 0 for (int j = 0; j < M; j++) {
                sum += Integer.parseInt(tempArr[j]) * MList[j];
            } int j = 0; int j = 0; j 0 j < M j M j++ j++ j {
                sum += Integer.parseInt(tempArr[j]) * MList[j];
            } {
                sum += Integer.parseInt(tempArr[j]) * MList[j];
            } sum += Integer.parseInt(tempArr[j]) * MList[j] sum Integer.parseInt(tempArr[j]) * MList[j] Integer.parseInt(tempArr[j]) Integer.parseInt Integer tempArr[j] tempArr j MList[j] MList j if ((sum + C) > 0) {
                counter++;
            } (sum + C) > 0 (sum + C) sum C 0 {
                counter++;
            } counter++ counter System.out.println(counter) System.out.println System.out System System.out counter String[] args args public class Main {


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Map<String,Integer> map = new HashMap<String,Integer>();

        String temp = sc.nextLine();

        String[] tempArr = temp.split(" ");

        int N = Integer.parseInt(tempArr[0]);
        int M = Integer.parseInt(tempArr[1]);
        int C = Integer.parseInt(tempArr[2]);

        int[] MList = new int[M];

        temp = sc.nextLine();
        tempArr = temp.split(" ");
        for (int j = 0; j < M; j++) {
            MList[j] = Integer.parseInt(tempArr[j]);
        }

        int sum = 0;
        int counter = 0;
        for (int i = 0; i < N; i++) {
            temp = sc.nextLine();
            tempArr = temp.split(" ");
            sum = 0;
            for (int j = 0; j < M; j++) {
                sum += Integer.parseInt(tempArr[j]) * MList[j];
            }
            if ((sum + C) > 0) {
                counter++;
            }
        }

        System.out.println(counter);





    }

} public class Main {


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Map<String,Integer> map = new HashMap<String,Integer>();

        String temp = sc.nextLine();

        String[] tempArr = temp.split(" ");

        int N = Integer.parseInt(tempArr[0]);
        int M = Integer.parseInt(tempArr[1]);
        int C = Integer.parseInt(tempArr[2]);

        int[] MList = new int[M];

        temp = sc.nextLine();
        tempArr = temp.split(" ");
        for (int j = 0; j < M; j++) {
            MList[j] = Integer.parseInt(tempArr[j]);
        }

        int sum = 0;
        int counter = 0;
        for (int i = 0; i < N; i++) {
            temp = sc.nextLine();
            tempArr = temp.split(" ");
            sum = 0;
            for (int j = 0; j < M; j++) {
                sum += Integer.parseInt(tempArr[j]) * MList[j];
            }
            if ((sum + C) > 0) {
                counter++;
            }
        }

        System.out.println(counter);





    }

} Main
import java.text.SimpleDateFormat;
import java.util.*;

public class Main {


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Map<String,Integer> map = new HashMap<String,Integer>();

        String temp = sc.nextLine();

        String[] tempArr = temp.split(" ");

        int N = Integer.parseInt(tempArr[0]);
        int M = Integer.parseInt(tempArr[1]);
        int C = Integer.parseInt(tempArr[2]);

        int[] MList = new int[M];

        temp = sc.nextLine();
        tempArr = temp.split(" ");
        for (int j = 0; j < M; j++) {
            MList[j] = Integer.parseInt(tempArr[j]);
        }

        int sum = 0;
        int counter = 0;
        for (int i = 0; i < N; i++) {
            temp = sc.nextLine();
            tempArr = temp.split(" ");
            sum = 0;
            for (int j = 0; j < M; j++) {
                sum += Integer.parseInt(tempArr[j]) * MList[j];
            }
            if ((sum + C) > 0) {
                counter++;
            }
        }

        System.out.println(counter);





    }

}
