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
 *
 * @author ky112233
 */
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);
        BCanYouSolveThis solver = new BCanYouSolveThis();
        solver.solve(1, in, out);
        out.close();
    }

    static class BCanYouSolveThis {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();
            int c = in.nextInt();
            int[] b = new int[m];
            for (int i = 0; i < m; i++) b[i] = in.nextInt();
            int[][] a = new int[n][m];
            for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) a[i][j] = in.nextInt();
            int cnt = 0;
            for (int i = 0; i < n; i++) {
                int sum = c;
                for (int j = 0; j < m; j++) {
                    sum += a[i][j] * b[j];
                }
                if (sum > 0) cnt++;
            }
            out.println(cnt);
        }

    }
}
 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);
        BCanYouSolveThis solver = new BCanYouSolveThis();
        solver.solve(1, in, out);
        out.close();
    }

    static class BCanYouSolveThis {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();
            int c = in.nextInt();
            int[] b = new int[m];
            for (int i = 0; i < m; i++) b[i] = in.nextInt();
            int[][] a = new int[n][m];
            for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) a[i][j] = in.nextInt();
            int cnt = 0;
            for (int i = 0; i < n; i++) {
                int sum = c;
                for (int j = 0; j < m; j++) {
                    sum += a[i][j] * b[j];
                }
                if (sum > 0) cnt++;
            }
            out.println(cnt);
        }

    }
} 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);
        BCanYouSolveThis solver = new BCanYouSolveThis();
        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);
        BCanYouSolveThis solver = new BCanYouSolveThis();
        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) BCanYouSolveThis solver = new BCanYouSolveThis(); solver new BCanYouSolveThis() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class BCanYouSolveThis {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();
            int c = in.nextInt();
            int[] b = new int[m];
            for (int i = 0; i < m; i++) b[i] = in.nextInt();
            int[][] a = new int[n][m];
            for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) a[i][j] = in.nextInt();
            int cnt = 0;
            for (int i = 0; i < n; i++) {
                int sum = c;
                for (int j = 0; j < m; j++) {
                    sum += a[i][j] * b[j];
                }
                if (sum > 0) cnt++;
            }
            out.println(cnt);
        }

    } BCanYouSolveThis public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();
            int c = in.nextInt();
            int[] b = new int[m];
            for (int i = 0; i < m; i++) b[i] = in.nextInt();
            int[][] a = new int[n][m];
            for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) a[i][j] = in.nextInt();
            int cnt = 0;
            for (int i = 0; i < n; i++) {
                int sum = c;
                for (int j = 0; j < m; j++) {
                    sum += a[i][j] * b[j];
                }
                if (sum > 0) cnt++;
            }
            out.println(cnt);
        } solve {
            int n = in.nextInt();
            int m = in.nextInt();
            int c = in.nextInt();
            int[] b = new int[m];
            for (int i = 0; i < m; i++) b[i] = in.nextInt();
            int[][] a = new int[n][m];
            for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) a[i][j] = in.nextInt();
            int cnt = 0;
            for (int i = 0; i < n; i++) {
                int sum = c;
                for (int j = 0; j < m; j++) {
                    sum += a[i][j] * b[j];
                }
                if (sum > 0) cnt++;
            }
            out.println(cnt);
        } 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[] 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] b i in.nextInt() in.nextInt in int[][] a = new int[n][m]; a new int[n][m] n m for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) a[i][j] = in.nextInt(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i for (int j = 0; j < m; j++) a[i][j] = in.nextInt(); for (int j = 0; j < m; j++) a[i][j] = in.nextInt(); int j = 0; int j = 0; j 0 j < m j m j++ j++ j a[i][j] = in.nextInt(); a[i][j] = in.nextInt() a[i][j] a[i] a i j in.nextInt() in.nextInt in int cnt = 0; cnt 0 for (int i = 0; i < n; i++) {
                int sum = c;
                for (int j = 0; j < m; j++) {
                    sum += a[i][j] * b[j];
                }
                if (sum > 0) cnt++;
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                int sum = c;
                for (int j = 0; j < m; j++) {
                    sum += a[i][j] * b[j];
                }
                if (sum > 0) cnt++;
            } {
                int sum = c;
                for (int j = 0; j < m; j++) {
                    sum += a[i][j] * b[j];
                }
                if (sum > 0) cnt++;
            } int sum = c; sum c for (int j = 0; j < m; j++) {
                    sum += a[i][j] * b[j];
                } int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
                    sum += a[i][j] * b[j];
                } {
                    sum += a[i][j] * b[j];
                } sum += a[i][j] * b[j] sum a[i][j] * b[j] a[i][j] a[i] a i j b[j] b j if (sum > 0) cnt++; sum > 0 sum 0 cnt++ cnt out.println(cnt) out.println out cnt 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);
        BCanYouSolveThis solver = new BCanYouSolveThis();
        solver.solve(1, in, out);
        out.close();
    }

    static class BCanYouSolveThis {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();
            int c = in.nextInt();
            int[] b = new int[m];
            for (int i = 0; i < m; i++) b[i] = in.nextInt();
            int[][] a = new int[n][m];
            for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) a[i][j] = in.nextInt();
            int cnt = 0;
            for (int i = 0; i < n; i++) {
                int sum = c;
                for (int j = 0; j < m; j++) {
                    sum += a[i][j] * b[j];
                }
                if (sum > 0) cnt++;
            }
            out.println(cnt);
        }

    }
} 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);
        BCanYouSolveThis solver = new BCanYouSolveThis();
        solver.solve(1, in, out);
        out.close();
    }

    static class BCanYouSolveThis {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();
            int c = in.nextInt();
            int[] b = new int[m];
            for (int i = 0; i < m; i++) b[i] = in.nextInt();
            int[][] a = new int[n][m];
            for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) a[i][j] = in.nextInt();
            int cnt = 0;
            for (int i = 0; i < n; i++) {
                int sum = c;
                for (int j = 0; j < m; j++) {
                    sum += a[i][j] * b[j];
                }
                if (sum > 0) cnt++;
            }
            out.println(cnt);
        }

    }
} 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
 *
 * @author ky112233
 */
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);
        BCanYouSolveThis solver = new BCanYouSolveThis();
        solver.solve(1, in, out);
        out.close();
    }

    static class BCanYouSolveThis {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();
            int c = in.nextInt();
            int[] b = new int[m];
            for (int i = 0; i < m; i++) b[i] = in.nextInt();
            int[][] a = new int[n][m];
            for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) a[i][j] = in.nextInt();
            int cnt = 0;
            for (int i = 0; i < n; i++) {
                int sum = c;
                for (int j = 0; j < m; j++) {
                    sum += a[i][j] * b[j];
                }
                if (sum > 0) cnt++;
            }
            out.println(cnt);
        }

    }
}

