import java.io.*;
import java.util.PriorityQueue;
import java.util.Queue;

public class Main {
    private static int LINE_NUMBER = 0;
    private static int CODE_NUMBER = 0;
    private static int BIAS = 0;

    private static int solver(int[] coe, int[] src) {

        int sum = BIAS;
        for (int i = 0; i < CODE_NUMBER; i++) {
            sum += (coe[i] * src[i]);
        }
        if(sum > 0){
            return 1;
        }else{
            return 0;
        }
    }


    public static void main(String[] args) {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(is);


        try {
            String[] inputArray = br.readLine().split(" ");
            LINE_NUMBER = Integer.parseInt(inputArray[0]);
            CODE_NUMBER = Integer.parseInt(inputArray[1]);
            BIAS = Integer.parseInt(inputArray[2]);
        } catch (Exception e) {
            e.printStackTrace();
        }

        int[] coe = new int[CODE_NUMBER];
        int[] src = new int[CODE_NUMBER];
        int answer = 0;
        try {
            String[] inputArray = br.readLine().split(" ");
            for (int j = 0; j < CODE_NUMBER; j++) {
                coe[j] = Integer.parseInt(inputArray[j]);
            }

            for (int line = 0; line < LINE_NUMBER; line++) {
                String[] srcArray = br.readLine().split(" ");
                for (int idx = 0; idx < CODE_NUMBER; idx++) {
                    src[idx] = Integer.parseInt(srcArray[idx]);
                }
                answer += solver(coe, src);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println(answer);

    }
} import java.io.*; io.* java import java.util.PriorityQueue; PriorityQueue java.util import java.util.Queue; Queue java.util public class Main {
    private static int LINE_NUMBER = 0;
    private static int CODE_NUMBER = 0;
    private static int BIAS = 0;

    private static int solver(int[] coe, int[] src) {

        int sum = BIAS;
        for (int i = 0; i < CODE_NUMBER; i++) {
            sum += (coe[i] * src[i]);
        }
        if(sum > 0){
            return 1;
        }else{
            return 0;
        }
    }


    public static void main(String[] args) {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(is);


        try {
            String[] inputArray = br.readLine().split(" ");
            LINE_NUMBER = Integer.parseInt(inputArray[0]);
            CODE_NUMBER = Integer.parseInt(inputArray[1]);
            BIAS = Integer.parseInt(inputArray[2]);
        } catch (Exception e) {
            e.printStackTrace();
        }

        int[] coe = new int[CODE_NUMBER];
        int[] src = new int[CODE_NUMBER];
        int answer = 0;
        try {
            String[] inputArray = br.readLine().split(" ");
            for (int j = 0; j < CODE_NUMBER; j++) {
                coe[j] = Integer.parseInt(inputArray[j]);
            }

            for (int line = 0; line < LINE_NUMBER; line++) {
                String[] srcArray = br.readLine().split(" ");
                for (int idx = 0; idx < CODE_NUMBER; idx++) {
                    src[idx] = Integer.parseInt(srcArray[idx]);
                }
                answer += solver(coe, src);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println(answer);

    }
} Main private static int LINE_NUMBER = 0; LINE_NUMBER 0 private static int CODE_NUMBER = 0; CODE_NUMBER 0 private static int BIAS = 0; BIAS 0 private static int solver(int[] coe, int[] src) {

        int sum = BIAS;
        for (int i = 0; i < CODE_NUMBER; i++) {
            sum += (coe[i] * src[i]);
        }
        if(sum > 0){
            return 1;
        }else{
            return 0;
        }
    } solver {

        int sum = BIAS;
        for (int i = 0; i < CODE_NUMBER; i++) {
            sum += (coe[i] * src[i]);
        }
        if(sum > 0){
            return 1;
        }else{
            return 0;
        }
    } int sum = BIAS; sum BIAS for (int i = 0; i < CODE_NUMBER; i++) {
            sum += (coe[i] * src[i]);
        } int i = 0; int i = 0; i 0 i < CODE_NUMBER i CODE_NUMBER i++ i++ i {
            sum += (coe[i] * src[i]);
        } {
            sum += (coe[i] * src[i]);
        } sum += (coe[i] * src[i]) sum (coe[i] * src[i]) coe[i] coe i src[i] src i if(sum > 0){
            return 1;
        }else{
            return 0;
        } sum > 0 sum 0 {
            return 1;
        } return 1; 1 {
            return 0;
        } return 0; 0 int[] coe coe int[] src src public static void main(String[] args) {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(is);


        try {
            String[] inputArray = br.readLine().split(" ");
            LINE_NUMBER = Integer.parseInt(inputArray[0]);
            CODE_NUMBER = Integer.parseInt(inputArray[1]);
            BIAS = Integer.parseInt(inputArray[2]);
        } catch (Exception e) {
            e.printStackTrace();
        }

        int[] coe = new int[CODE_NUMBER];
        int[] src = new int[CODE_NUMBER];
        int answer = 0;
        try {
            String[] inputArray = br.readLine().split(" ");
            for (int j = 0; j < CODE_NUMBER; j++) {
                coe[j] = Integer.parseInt(inputArray[j]);
            }

            for (int line = 0; line < LINE_NUMBER; line++) {
                String[] srcArray = br.readLine().split(" ");
                for (int idx = 0; idx < CODE_NUMBER; idx++) {
                    src[idx] = Integer.parseInt(srcArray[idx]);
                }
                answer += solver(coe, src);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println(answer);

    } main {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(is);


        try {
            String[] inputArray = br.readLine().split(" ");
            LINE_NUMBER = Integer.parseInt(inputArray[0]);
            CODE_NUMBER = Integer.parseInt(inputArray[1]);
            BIAS = Integer.parseInt(inputArray[2]);
        } catch (Exception e) {
            e.printStackTrace();
        }

        int[] coe = new int[CODE_NUMBER];
        int[] src = new int[CODE_NUMBER];
        int answer = 0;
        try {
            String[] inputArray = br.readLine().split(" ");
            for (int j = 0; j < CODE_NUMBER; j++) {
                coe[j] = Integer.parseInt(inputArray[j]);
            }

            for (int line = 0; line < LINE_NUMBER; line++) {
                String[] srcArray = br.readLine().split(" ");
                for (int idx = 0; idx < CODE_NUMBER; idx++) {
                    src[idx] = Integer.parseInt(srcArray[idx]);
                }
                answer += solver(coe, src);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println(answer);

    } InputStreamReader is = new InputStreamReader(System.in); is new InputStreamReader(System.in) BufferedReader br = new BufferedReader(is); br new BufferedReader(is) try {
            String[] inputArray = br.readLine().split(" ");
            LINE_NUMBER = Integer.parseInt(inputArray[0]);
            CODE_NUMBER = Integer.parseInt(inputArray[1]);
            BIAS = Integer.parseInt(inputArray[2]);
        } catch (Exception e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        } Exception e {
            e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
            String[] inputArray = br.readLine().split(" ");
            LINE_NUMBER = Integer.parseInt(inputArray[0]);
            CODE_NUMBER = Integer.parseInt(inputArray[1]);
            BIAS = Integer.parseInt(inputArray[2]);
        } String[] inputArray = br.readLine().split(" "); inputArray br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " LINE_NUMBER = Integer.parseInt(inputArray[0]) LINE_NUMBER Integer.parseInt(inputArray[0]) Integer.parseInt Integer inputArray[0] inputArray 0 CODE_NUMBER = Integer.parseInt(inputArray[1]) CODE_NUMBER Integer.parseInt(inputArray[1]) Integer.parseInt Integer inputArray[1] inputArray 1 BIAS = Integer.parseInt(inputArray[2]) BIAS Integer.parseInt(inputArray[2]) Integer.parseInt Integer inputArray[2] inputArray 2 int[] coe = new int[CODE_NUMBER]; coe new int[CODE_NUMBER] CODE_NUMBER int[] src = new int[CODE_NUMBER]; src new int[CODE_NUMBER] CODE_NUMBER int answer = 0; answer 0 try {
            String[] inputArray = br.readLine().split(" ");
            for (int j = 0; j < CODE_NUMBER; j++) {
                coe[j] = Integer.parseInt(inputArray[j]);
            }

            for (int line = 0; line < LINE_NUMBER; line++) {
                String[] srcArray = br.readLine().split(" ");
                for (int idx = 0; idx < CODE_NUMBER; idx++) {
                    src[idx] = Integer.parseInt(srcArray[idx]);
                }
                answer += solver(coe, src);
            }
        } catch (Exception e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        } Exception e {
            e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
            String[] inputArray = br.readLine().split(" ");
            for (int j = 0; j < CODE_NUMBER; j++) {
                coe[j] = Integer.parseInt(inputArray[j]);
            }

            for (int line = 0; line < LINE_NUMBER; line++) {
                String[] srcArray = br.readLine().split(" ");
                for (int idx = 0; idx < CODE_NUMBER; idx++) {
                    src[idx] = Integer.parseInt(srcArray[idx]);
                }
                answer += solver(coe, src);
            }
        } String[] inputArray = br.readLine().split(" "); inputArray br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " for (int j = 0; j < CODE_NUMBER; j++) {
                coe[j] = Integer.parseInt(inputArray[j]);
            } int j = 0; int j = 0; j 0 j < CODE_NUMBER j CODE_NUMBER j++ j++ j {
                coe[j] = Integer.parseInt(inputArray[j]);
            } {
                coe[j] = Integer.parseInt(inputArray[j]);
            } coe[j] = Integer.parseInt(inputArray[j]) coe[j] coe j Integer.parseInt(inputArray[j]) Integer.parseInt Integer inputArray[j] inputArray j for (int line = 0; line < LINE_NUMBER; line++) {
                String[] srcArray = br.readLine().split(" ");
                for (int idx = 0; idx < CODE_NUMBER; idx++) {
                    src[idx] = Integer.parseInt(srcArray[idx]);
                }
                answer += solver(coe, src);
            } int line = 0; int line = 0; line 0 line < LINE_NUMBER line LINE_NUMBER line++ line++ line {
                String[] srcArray = br.readLine().split(" ");
                for (int idx = 0; idx < CODE_NUMBER; idx++) {
                    src[idx] = Integer.parseInt(srcArray[idx]);
                }
                answer += solver(coe, src);
            } {
                String[] srcArray = br.readLine().split(" ");
                for (int idx = 0; idx < CODE_NUMBER; idx++) {
                    src[idx] = Integer.parseInt(srcArray[idx]);
                }
                answer += solver(coe, src);
            } String[] srcArray = br.readLine().split(" "); srcArray br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " for (int idx = 0; idx < CODE_NUMBER; idx++) {
                    src[idx] = Integer.parseInt(srcArray[idx]);
                } int idx = 0; int idx = 0; idx 0 idx < CODE_NUMBER idx CODE_NUMBER idx++ idx++ idx {
                    src[idx] = Integer.parseInt(srcArray[idx]);
                } {
                    src[idx] = Integer.parseInt(srcArray[idx]);
                } src[idx] = Integer.parseInt(srcArray[idx]) src[idx] src idx Integer.parseInt(srcArray[idx]) Integer.parseInt Integer srcArray[idx] srcArray idx answer += solver(coe, src) answer solver(coe, src) solver coe src System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {
    private static int LINE_NUMBER = 0;
    private static int CODE_NUMBER = 0;
    private static int BIAS = 0;

    private static int solver(int[] coe, int[] src) {

        int sum = BIAS;
        for (int i = 0; i < CODE_NUMBER; i++) {
            sum += (coe[i] * src[i]);
        }
        if(sum > 0){
            return 1;
        }else{
            return 0;
        }
    }


    public static void main(String[] args) {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(is);


        try {
            String[] inputArray = br.readLine().split(" ");
            LINE_NUMBER = Integer.parseInt(inputArray[0]);
            CODE_NUMBER = Integer.parseInt(inputArray[1]);
            BIAS = Integer.parseInt(inputArray[2]);
        } catch (Exception e) {
            e.printStackTrace();
        }

        int[] coe = new int[CODE_NUMBER];
        int[] src = new int[CODE_NUMBER];
        int answer = 0;
        try {
            String[] inputArray = br.readLine().split(" ");
            for (int j = 0; j < CODE_NUMBER; j++) {
                coe[j] = Integer.parseInt(inputArray[j]);
            }

            for (int line = 0; line < LINE_NUMBER; line++) {
                String[] srcArray = br.readLine().split(" ");
                for (int idx = 0; idx < CODE_NUMBER; idx++) {
                    src[idx] = Integer.parseInt(srcArray[idx]);
                }
                answer += solver(coe, src);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println(answer);

    }
} public class Main {
    private static int LINE_NUMBER = 0;
    private static int CODE_NUMBER = 0;
    private static int BIAS = 0;

    private static int solver(int[] coe, int[] src) {

        int sum = BIAS;
        for (int i = 0; i < CODE_NUMBER; i++) {
            sum += (coe[i] * src[i]);
        }
        if(sum > 0){
            return 1;
        }else{
            return 0;
        }
    }


    public static void main(String[] args) {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(is);


        try {
            String[] inputArray = br.readLine().split(" ");
            LINE_NUMBER = Integer.parseInt(inputArray[0]);
            CODE_NUMBER = Integer.parseInt(inputArray[1]);
            BIAS = Integer.parseInt(inputArray[2]);
        } catch (Exception e) {
            e.printStackTrace();
        }

        int[] coe = new int[CODE_NUMBER];
        int[] src = new int[CODE_NUMBER];
        int answer = 0;
        try {
            String[] inputArray = br.readLine().split(" ");
            for (int j = 0; j < CODE_NUMBER; j++) {
                coe[j] = Integer.parseInt(inputArray[j]);
            }

            for (int line = 0; line < LINE_NUMBER; line++) {
                String[] srcArray = br.readLine().split(" ");
                for (int idx = 0; idx < CODE_NUMBER; idx++) {
                    src[idx] = Integer.parseInt(srcArray[idx]);
                }
                answer += solver(coe, src);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println(answer);

    }
} Main
import java.io.*;
import java.util.PriorityQueue;
import java.util.Queue;

public class Main {
    private static int LINE_NUMBER = 0;
    private static int CODE_NUMBER = 0;
    private static int BIAS = 0;

    private static int solver(int[] coe, int[] src) {

        int sum = BIAS;
        for (int i = 0; i < CODE_NUMBER; i++) {
            sum += (coe[i] * src[i]);
        }
        if(sum > 0){
            return 1;
        }else{
            return 0;
        }
    }


    public static void main(String[] args) {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(is);


        try {
            String[] inputArray = br.readLine().split(" ");
            LINE_NUMBER = Integer.parseInt(inputArray[0]);
            CODE_NUMBER = Integer.parseInt(inputArray[1]);
            BIAS = Integer.parseInt(inputArray[2]);
        } catch (Exception e) {
            e.printStackTrace();
        }

        int[] coe = new int[CODE_NUMBER];
        int[] src = new int[CODE_NUMBER];
        int answer = 0;
        try {
            String[] inputArray = br.readLine().split(" ");
            for (int j = 0; j < CODE_NUMBER; j++) {
                coe[j] = Integer.parseInt(inputArray[j]);
            }

            for (int line = 0; line < LINE_NUMBER; line++) {
                String[] srcArray = br.readLine().split(" ");
                for (int idx = 0; idx < CODE_NUMBER; idx++) {
                    src[idx] = Integer.parseInt(srcArray[idx]);
                }
                answer += solver(coe, src);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println(answer);

    }
}