import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ABC121_2 solver = new ABC121_2();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC121_2 {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            int M = in.nextInt();
            int C = in.nextInt();
            int accnt = 0;
            int[] B = new int[M];
            for (int i = 0; i < M; i++) {
                B[i] = in.nextInt();
            }
            for (int i = 0; i < N; i++) {
                int ttl = 0;
                for (int b : B) {
                    int A = in.nextInt() * b;
                    ttl += A;
                }
                if ((ttl + C) > 0) {
                    accnt++;
                }
            }
            out.println(accnt);

        }

    }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ABC121_2 solver = new ABC121_2();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC121_2 {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            int M = in.nextInt();
            int C = in.nextInt();
            int accnt = 0;
            int[] B = new int[M];
            for (int i = 0; i < M; i++) {
                B[i] = in.nextInt();
            }
            for (int i = 0; i < N; i++) {
                int ttl = 0;
                for (int b : B) {
                    int A = in.nextInt() * b;
                    ttl += A;
                }
                if ((ttl + C) > 0) {
                    accnt++;
                }
            }
            out.println(accnt);

        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ABC121_2 solver = new ABC121_2();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ABC121_2 solver = new ABC121_2();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out Scanner in = new Scanner(inputStream); in new Scanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) ABC121_2 solver = new ABC121_2(); solver new ABC121_2() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class ABC121_2 {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            int M = in.nextInt();
            int C = in.nextInt();
            int accnt = 0;
            int[] B = new int[M];
            for (int i = 0; i < M; i++) {
                B[i] = in.nextInt();
            }
            for (int i = 0; i < N; i++) {
                int ttl = 0;
                for (int b : B) {
                    int A = in.nextInt() * b;
                    ttl += A;
                }
                if ((ttl + C) > 0) {
                    accnt++;
                }
            }
            out.println(accnt);

        }

    } ABC121_2 public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            int M = in.nextInt();
            int C = in.nextInt();
            int accnt = 0;
            int[] B = new int[M];
            for (int i = 0; i < M; i++) {
                B[i] = in.nextInt();
            }
            for (int i = 0; i < N; i++) {
                int ttl = 0;
                for (int b : B) {
                    int A = in.nextInt() * b;
                    ttl += A;
                }
                if ((ttl + C) > 0) {
                    accnt++;
                }
            }
            out.println(accnt);

        } solve {
            int N = in.nextInt();
            int M = in.nextInt();
            int C = in.nextInt();
            int accnt = 0;
            int[] B = new int[M];
            for (int i = 0; i < M; i++) {
                B[i] = in.nextInt();
            }
            for (int i = 0; i < N; i++) {
                int ttl = 0;
                for (int b : B) {
                    int A = in.nextInt() * b;
                    ttl += A;
                }
                if ((ttl + C) > 0) {
                    accnt++;
                }
            }
            out.println(accnt);

        } int N = in.nextInt(); N in.nextInt() in.nextInt in int M = in.nextInt(); M in.nextInt() in.nextInt in int C = in.nextInt(); C in.nextInt() in.nextInt in int accnt = 0; accnt 0 int[] B = new int[M]; B new int[M] M for (int i = 0; i < M; i++) {
                B[i] = in.nextInt();
            } int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
                B[i] = in.nextInt();
            } {
                B[i] = in.nextInt();
            } B[i] = in.nextInt() B[i] B i in.nextInt() in.nextInt in for (int i = 0; i < N; i++) {
                int ttl = 0;
                for (int b : B) {
                    int A = in.nextInt() * b;
                    ttl += A;
                }
                if ((ttl + C) > 0) {
                    accnt++;
                }
            } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
                int ttl = 0;
                for (int b : B) {
                    int A = in.nextInt() * b;
                    ttl += A;
                }
                if ((ttl + C) > 0) {
                    accnt++;
                }
            } {
                int ttl = 0;
                for (int b : B) {
                    int A = in.nextInt() * b;
                    ttl += A;
                }
                if ((ttl + C) > 0) {
                    accnt++;
                }
            } int ttl = 0; ttl 0 for (int b : B) {
                    int A = in.nextInt() * b;
                    ttl += A;
                } int b B {
                    int A = in.nextInt() * b;
                    ttl += A;
                } {
                    int A = in.nextInt() * b;
                    ttl += A;
                } int A = in.nextInt() * b; A in.nextInt() * b in.nextInt() in.nextInt in b ttl += A ttl A if ((ttl + C) > 0) {
                    accnt++;
                } (ttl + C) > 0 (ttl + C) ttl C 0 {
                    accnt++;
                } accnt++ accnt out.println(accnt) out.println out accnt int testNumber testNumber Scanner in in PrintWriter out out public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ABC121_2 solver = new ABC121_2();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC121_2 {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            int M = in.nextInt();
            int C = in.nextInt();
            int accnt = 0;
            int[] B = new int[M];
            for (int i = 0; i < M; i++) {
                B[i] = in.nextInt();
            }
            for (int i = 0; i < N; i++) {
                int ttl = 0;
                for (int b : B) {
                    int A = in.nextInt() * b;
                    ttl += A;
                }
                if ((ttl + C) > 0) {
                    accnt++;
                }
            }
            out.println(accnt);

        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ABC121_2 solver = new ABC121_2();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC121_2 {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            int M = in.nextInt();
            int C = in.nextInt();
            int accnt = 0;
            int[] B = new int[M];
            for (int i = 0; i < M; i++) {
                B[i] = in.nextInt();
            }
            for (int i = 0; i < N; i++) {
                int ttl = 0;
                for (int b : B) {
                    int A = in.nextInt() * b;
                    ttl += A;
                }
                if ((ttl + C) > 0) {
                    accnt++;
                }
            }
            out.println(accnt);

        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ABC121_2 solver = new ABC121_2();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC121_2 {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            int M = in.nextInt();
            int C = in.nextInt();
            int accnt = 0;
            int[] B = new int[M];
            for (int i = 0; i < M; i++) {
                B[i] = in.nextInt();
            }
            for (int i = 0; i < N; i++) {
                int ttl = 0;
                for (int b : B) {
                    int A = in.nextInt() * b;
                    ttl += A;
                }
                if ((ttl + C) > 0) {
                    accnt++;
                }
            }
            out.println(accnt);

        }

    }
}

