import java.io.BufferedOutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
    public static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        ArrayList<Integer> b_list = new ArrayList<>();
        for (int i = 0; i < m; i++) {
            b_list.add(Integer.parseInt(sc.next()));
        }
        int ans = 0;
        for (int i = 0; i < n; i++) {
            int sum = 0;
            for (int j = 0, a = 0; j < m; j++) {
                a = Integer.parseInt(sc.next());
                sum += a * b_list.get(j);
            }
            sum += c;
            if (sum > 0) {
                ans++;
            }
        }
        out.println(ans);
        sc.close();
        out.close();
    }

} import java.io.BufferedOutputStream; BufferedOutputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main {
    public static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        ArrayList<Integer> b_list = new ArrayList<>();
        for (int i = 0; i < m; i++) {
            b_list.add(Integer.parseInt(sc.next()));
        }
        int ans = 0;
        for (int i = 0; i < n; i++) {
            int sum = 0;
            for (int j = 0, a = 0; j < m; j++) {
                a = Integer.parseInt(sc.next());
                sum += a * b_list.get(j);
            }
            sum += c;
            if (sum > 0) {
                ans++;
            }
        }
        out.println(ans);
        sc.close();
        out.close();
    }

} Main public static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)); out new PrintWriter(new BufferedOutputStream(System.out)) public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        ArrayList<Integer> b_list = new ArrayList<>();
        for (int i = 0; i < m; i++) {
            b_list.add(Integer.parseInt(sc.next()));
        }
        int ans = 0;
        for (int i = 0; i < n; i++) {
            int sum = 0;
            for (int j = 0, a = 0; j < m; j++) {
                a = Integer.parseInt(sc.next());
                sum += a * b_list.get(j);
            }
            sum += c;
            if (sum > 0) {
                ans++;
            }
        }
        out.println(ans);
        sc.close();
        out.close();
    } main {
        Scanner sc = new Scanner(System.in);

        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        ArrayList<Integer> b_list = new ArrayList<>();
        for (int i = 0; i < m; i++) {
            b_list.add(Integer.parseInt(sc.next()));
        }
        int ans = 0;
        for (int i = 0; i < n; i++) {
            int sum = 0;
            for (int j = 0, a = 0; j < m; j++) {
                a = Integer.parseInt(sc.next());
                sum += a * b_list.get(j);
            }
            sum += c;
            if (sum > 0) {
                ans++;
            }
        }
        out.println(ans);
        sc.close();
        out.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int m = Integer.parseInt(sc.next()); m Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int c = Integer.parseInt(sc.next()); c Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc ArrayList<Integer> b_list = new ArrayList<>(); b_list new ArrayList<>() for (int i = 0; i < m; i++) {
            b_list.add(Integer.parseInt(sc.next()));
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            b_list.add(Integer.parseInt(sc.next()));
        } {
            b_list.add(Integer.parseInt(sc.next()));
        } b_list.add(Integer.parseInt(sc.next())) b_list.add b_list Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int ans = 0; ans 0 for (int i = 0; i < n; i++) {
            int sum = 0;
            for (int j = 0, a = 0; j < m; j++) {
                a = Integer.parseInt(sc.next());
                sum += a * b_list.get(j);
            }
            sum += c;
            if (sum > 0) {
                ans++;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            int sum = 0;
            for (int j = 0, a = 0; j < m; j++) {
                a = Integer.parseInt(sc.next());
                sum += a * b_list.get(j);
            }
            sum += c;
            if (sum > 0) {
                ans++;
            }
        } {
            int sum = 0;
            for (int j = 0, a = 0; j < m; j++) {
                a = Integer.parseInt(sc.next());
                sum += a * b_list.get(j);
            }
            sum += c;
            if (sum > 0) {
                ans++;
            }
        } int sum = 0; sum 0 for (int j = 0, a = 0; j < m; j++) {
                a = Integer.parseInt(sc.next());
                sum += a * b_list.get(j);
            } int j = 0, a = 0; int j = 0 j 0 a = 0; a 0 j < m j m j++ j++ j {
                a = Integer.parseInt(sc.next());
                sum += a * b_list.get(j);
            } {
                a = Integer.parseInt(sc.next());
                sum += a * b_list.get(j);
            } a = Integer.parseInt(sc.next()) a Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc sum += a * b_list.get(j) sum a * b_list.get(j) a b_list.get(j) b_list.get b_list j sum += c sum c if (sum > 0) {
                ans++;
            } sum > 0 sum 0 {
                ans++;
            } ans++ ans out.println(ans) out.println out ans sc.close() sc.close sc out.close() out.close out String[] args args public class Main {
    public static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        ArrayList<Integer> b_list = new ArrayList<>();
        for (int i = 0; i < m; i++) {
            b_list.add(Integer.parseInt(sc.next()));
        }
        int ans = 0;
        for (int i = 0; i < n; i++) {
            int sum = 0;
            for (int j = 0, a = 0; j < m; j++) {
                a = Integer.parseInt(sc.next());
                sum += a * b_list.get(j);
            }
            sum += c;
            if (sum > 0) {
                ans++;
            }
        }
        out.println(ans);
        sc.close();
        out.close();
    }

} public class Main {
    public static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        ArrayList<Integer> b_list = new ArrayList<>();
        for (int i = 0; i < m; i++) {
            b_list.add(Integer.parseInt(sc.next()));
        }
        int ans = 0;
        for (int i = 0; i < n; i++) {
            int sum = 0;
            for (int j = 0, a = 0; j < m; j++) {
                a = Integer.parseInt(sc.next());
                sum += a * b_list.get(j);
            }
            sum += c;
            if (sum > 0) {
                ans++;
            }
        }
        out.println(ans);
        sc.close();
        out.close();
    }

} Main
import java.io.BufferedOutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
    public static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        ArrayList<Integer> b_list = new ArrayList<>();
        for (int i = 0; i < m; i++) {
            b_list.add(Integer.parseInt(sc.next()));
        }
        int ans = 0;
        for (int i = 0; i < n; i++) {
            int sum = 0;
            for (int j = 0, a = 0; j < m; j++) {
                a = Integer.parseInt(sc.next());
                sum += a * b_list.get(j);
            }
            sum += c;
            if (sum > 0) {
                ans++;
            }
        }
        out.println(ans);
        sc.close();
        out.close();
    }

}