import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Main {

    public static void main(String[] args) throws Exception {
        String[] inputs = Io.read();
        String[] meta = inputs[0].split(" ");

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

        int[][] sources = parse(inputs, N, M);

        int count = 0;

        for (int i = 1; i < sources.length; i++) {
            count += isCorrect(sources[0], sources[i], C) ? 1 : 0;
        }

        Io.write(count);
    }

    private static int[][] parse(String[] lines, int N, int M) {
        int[][] result = new int[N + 1][M];
        for (int i = 0; i < N + 1; i++) {
            String[] split = lines[i + 1].split(" ");
            for (int x = 0; x < M; x++) {
                result[i][x] = Integer.parseInt(split[x]);
            }
        }
        return result;
    }

    private static boolean isCorrect(int[] Bs, int[] As, int C) {
        int sum = C;
        for (int i = 0; i < Bs.length; i++) {
            sum += Bs[i] * As[i];
        }
        return sum > 0;
    }
}


class Io {

    /**
     * 標準入力から1行ずつ受け取る
     * @return
     * @throws IOException
     */
    public static String[] read() throws IOException
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        List<String> inputs = new ArrayList<>();
        String line;
        while ((line = br.readLine()) != null) {
            if (line.equals(""))
                break;

            inputs.add(line);
        }
        br.close();
        return inputs.toArray(new String[0]);
    }

    /**
     * 標準出力
     * @param answer
     */
    public static void write(int answer)
    {
        System.out.println(answer);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.List; List java.util public class Main {

    public static void main(String[] args) throws Exception {
        String[] inputs = Io.read();
        String[] meta = inputs[0].split(" ");

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

        int[][] sources = parse(inputs, N, M);

        int count = 0;

        for (int i = 1; i < sources.length; i++) {
            count += isCorrect(sources[0], sources[i], C) ? 1 : 0;
        }

        Io.write(count);
    }

    private static int[][] parse(String[] lines, int N, int M) {
        int[][] result = new int[N + 1][M];
        for (int i = 0; i < N + 1; i++) {
            String[] split = lines[i + 1].split(" ");
            for (int x = 0; x < M; x++) {
                result[i][x] = Integer.parseInt(split[x]);
            }
        }
        return result;
    }

    private static boolean isCorrect(int[] Bs, int[] As, int C) {
        int sum = C;
        for (int i = 0; i < Bs.length; i++) {
            sum += Bs[i] * As[i];
        }
        return sum > 0;
    }
} Main public static void main(String[] args) throws Exception {
        String[] inputs = Io.read();
        String[] meta = inputs[0].split(" ");

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

        int[][] sources = parse(inputs, N, M);

        int count = 0;

        for (int i = 1; i < sources.length; i++) {
            count += isCorrect(sources[0], sources[i], C) ? 1 : 0;
        }

        Io.write(count);
    } main {
        String[] inputs = Io.read();
        String[] meta = inputs[0].split(" ");

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

        int[][] sources = parse(inputs, N, M);

        int count = 0;

        for (int i = 1; i < sources.length; i++) {
            count += isCorrect(sources[0], sources[i], C) ? 1 : 0;
        }

        Io.write(count);
    } String[] inputs = Io.read(); inputs Io.read() Io.read Io String[] meta = inputs[0].split(" "); meta inputs[0].split(" ") inputs[0].split inputs[0] inputs 0 " " int N = Integer.parseInt(meta[0]); N Integer.parseInt(meta[0]) Integer.parseInt Integer meta[0] meta 0 int M = Integer.parseInt(meta[1]); M Integer.parseInt(meta[1]) Integer.parseInt Integer meta[1] meta 1 int C = Integer.parseInt(meta[2]); C Integer.parseInt(meta[2]) Integer.parseInt Integer meta[2] meta 2 int[][] sources = parse(inputs, N, M); sources parse(inputs, N, M) parse inputs N M int count = 0; count 0 for (int i = 1; i < sources.length; i++) {
            count += isCorrect(sources[0], sources[i], C) ? 1 : 0;
        } int i = 1; int i = 1; i 1 i < sources.length i sources.length sources sources.length i++ i++ i {
            count += isCorrect(sources[0], sources[i], C) ? 1 : 0;
        } {
            count += isCorrect(sources[0], sources[i], C) ? 1 : 0;
        } count += isCorrect(sources[0], sources[i], C) ? 1 : 0 count isCorrect(sources[0], sources[i], C) ? 1 : 0 isCorrect(sources[0], sources[i], C) isCorrect sources[0] sources 0 sources[i] sources i C 1 0 Io.write(count) Io.write Io count String[] args args private static int[][] parse(String[] lines, int N, int M) {
        int[][] result = new int[N + 1][M];
        for (int i = 0; i < N + 1; i++) {
            String[] split = lines[i + 1].split(" ");
            for (int x = 0; x < M; x++) {
                result[i][x] = Integer.parseInt(split[x]);
            }
        }
        return result;
    } parse {
        int[][] result = new int[N + 1][M];
        for (int i = 0; i < N + 1; i++) {
            String[] split = lines[i + 1].split(" ");
            for (int x = 0; x < M; x++) {
                result[i][x] = Integer.parseInt(split[x]);
            }
        }
        return result;
    } int[][] result = new int[N + 1][M]; result new int[N + 1][M] N + 1 N 1 M for (int i = 0; i < N + 1; i++) {
            String[] split = lines[i + 1].split(" ");
            for (int x = 0; x < M; x++) {
                result[i][x] = Integer.parseInt(split[x]);
            }
        } int i = 0; int i = 0; i 0 i < N + 1 i N + 1 N 1 i++ i++ i {
            String[] split = lines[i + 1].split(" ");
            for (int x = 0; x < M; x++) {
                result[i][x] = Integer.parseInt(split[x]);
            }
        } {
            String[] split = lines[i + 1].split(" ");
            for (int x = 0; x < M; x++) {
                result[i][x] = Integer.parseInt(split[x]);
            }
        } String[] split = lines[i + 1].split(" "); split lines[i + 1].split(" ") lines[i + 1].split lines[i + 1] lines i + 1 i 1 " " for (int x = 0; x < M; x++) {
                result[i][x] = Integer.parseInt(split[x]);
            } int x = 0; int x = 0; x 0 x < M x M x++ x++ x {
                result[i][x] = Integer.parseInt(split[x]);
            } {
                result[i][x] = Integer.parseInt(split[x]);
            } result[i][x] = Integer.parseInt(split[x]) result[i][x] result[i] result i x Integer.parseInt(split[x]) Integer.parseInt Integer split[x] split x return result; result String[] lines lines int N N int M M private static boolean isCorrect(int[] Bs, int[] As, int C) {
        int sum = C;
        for (int i = 0; i < Bs.length; i++) {
            sum += Bs[i] * As[i];
        }
        return sum > 0;
    } isCorrect {
        int sum = C;
        for (int i = 0; i < Bs.length; i++) {
            sum += Bs[i] * As[i];
        }
        return sum > 0;
    } int sum = C; sum C for (int i = 0; i < Bs.length; i++) {
            sum += Bs[i] * As[i];
        } int i = 0; int i = 0; i 0 i < Bs.length i Bs.length Bs Bs.length i++ i++ i {
            sum += Bs[i] * As[i];
        } {
            sum += Bs[i] * As[i];
        } sum += Bs[i] * As[i] sum Bs[i] * As[i] Bs[i] Bs i As[i] As i return sum > 0; sum > 0 sum 0 int[] Bs Bs int[] As As int C C class Io {

    /**
     * 標準入力から1行ずつ受け取る
     * @return
     * @throws IOException
     */
    public static String[] read() throws IOException
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        List<String> inputs = new ArrayList<>();
        String line;
        while ((line = br.readLine()) != null) {
            if (line.equals(""))
                break;

            inputs.add(line);
        }
        br.close();
        return inputs.toArray(new String[0]);
    }

    /**
     * 標準出力
     * @param answer
     */
    public static void write(int answer)
    {
        System.out.println(answer);
    }
} Io /**
     * 標準入力から1行ずつ受け取る
     * @return
     * @throws IOException
     */
    public static String[] read() throws IOException
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        List<String> inputs = new ArrayList<>();
        String line;
        while ((line = br.readLine()) != null) {
            if (line.equals(""))
                break;

            inputs.add(line);
        }
        br.close();
        return inputs.toArray(new String[0]);
    } read {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        List<String> inputs = new ArrayList<>();
        String line;
        while ((line = br.readLine()) != null) {
            if (line.equals(""))
                break;

            inputs.add(line);
        }
        br.close();
        return inputs.toArray(new String[0]);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) List<String> inputs = new ArrayList<>(); inputs new ArrayList<>() String line; line while ((line = br.readLine()) != null) {
            if (line.equals(""))
                break;

            inputs.add(line);
        } (line = br.readLine()) != null (line = br.readLine()) line br.readLine() br.readLine br null {
            if (line.equals(""))
                break;

            inputs.add(line);
        } if (line.equals(""))
                break; line.equals("") line.equals line "" break; inputs.add(line) inputs.add inputs line br.close() br.close br return inputs.toArray(new String[0]); inputs.toArray(new String[0]) inputs.toArray inputs new String[0] 0 /**
     * 標準出力
     * @param answer
     */
    public static void write(int answer)
    {
        System.out.println(answer);
    } write {
        System.out.println(answer);
    } System.out.println(answer) System.out.println System.out System System.out answer int answer answer public class Main {

    public static void main(String[] args) throws Exception {
        String[] inputs = Io.read();
        String[] meta = inputs[0].split(" ");

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

        int[][] sources = parse(inputs, N, M);

        int count = 0;

        for (int i = 1; i < sources.length; i++) {
            count += isCorrect(sources[0], sources[i], C) ? 1 : 0;
        }

        Io.write(count);
    }

    private static int[][] parse(String[] lines, int N, int M) {
        int[][] result = new int[N + 1][M];
        for (int i = 0; i < N + 1; i++) {
            String[] split = lines[i + 1].split(" ");
            for (int x = 0; x < M; x++) {
                result[i][x] = Integer.parseInt(split[x]);
            }
        }
        return result;
    }

    private static boolean isCorrect(int[] Bs, int[] As, int C) {
        int sum = C;
        for (int i = 0; i < Bs.length; i++) {
            sum += Bs[i] * As[i];
        }
        return sum > 0;
    }
} public class Main {

    public static void main(String[] args) throws Exception {
        String[] inputs = Io.read();
        String[] meta = inputs[0].split(" ");

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

        int[][] sources = parse(inputs, N, M);

        int count = 0;

        for (int i = 1; i < sources.length; i++) {
            count += isCorrect(sources[0], sources[i], C) ? 1 : 0;
        }

        Io.write(count);
    }

    private static int[][] parse(String[] lines, int N, int M) {
        int[][] result = new int[N + 1][M];
        for (int i = 0; i < N + 1; i++) {
            String[] split = lines[i + 1].split(" ");
            for (int x = 0; x < M; x++) {
                result[i][x] = Integer.parseInt(split[x]);
            }
        }
        return result;
    }

    private static boolean isCorrect(int[] Bs, int[] As, int C) {
        int sum = C;
        for (int i = 0; i < Bs.length; i++) {
            sum += Bs[i] * As[i];
        }
        return sum > 0;
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Main {

    public static void main(String[] args) throws Exception {
        String[] inputs = Io.read();
        String[] meta = inputs[0].split(" ");

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

        int[][] sources = parse(inputs, N, M);

        int count = 0;

        for (int i = 1; i < sources.length; i++) {
            count += isCorrect(sources[0], sources[i], C) ? 1 : 0;
        }

        Io.write(count);
    }

    private static int[][] parse(String[] lines, int N, int M) {
        int[][] result = new int[N + 1][M];
        for (int i = 0; i < N + 1; i++) {
            String[] split = lines[i + 1].split(" ");
            for (int x = 0; x < M; x++) {
                result[i][x] = Integer.parseInt(split[x]);
            }
        }
        return result;
    }

    private static boolean isCorrect(int[] Bs, int[] As, int C) {
        int sum = C;
        for (int i = 0; i < Bs.length; i++) {
            sum += Bs[i] * As[i];
        }
        return sum > 0;
    }
}


class Io {

    /**
     * 標準入力から1行ずつ受け取る
     * @return
     * @throws IOException
     */
    public static String[] read() throws IOException
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        List<String> inputs = new ArrayList<>();
        String line;
        while ((line = br.readLine()) != null) {
            if (line.equals(""))
                break;

            inputs.add(line);
        }
        br.close();
        return inputs.toArray(new String[0]);
    }

    /**
     * 標準出力
     * @param answer
     */
    public static void write(int answer)
    {
        System.out.println(answer);
    }
}
