import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int c = sc.nextInt();
        List<Integer> b = new ArrayList<>();
        for (int i = 0; i < m; i++) {
            b.add(sc.nextInt());
        }
        int ans = 0;
        for (int i = 0; i < n; i++) {
            int sum = 0;
            for (int j = 0; j < m; j++) {
                int k = sc.nextInt();
                sum += b.get(j) * k;
            }
            sum += c;
            if (sum > 0) {
                ans++;
            }
        }
        System.out.println(ans);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int c = sc.nextInt();
        List<Integer> b = new ArrayList<>();
        for (int i = 0; i < m; i++) {
            b.add(sc.nextInt());
        }
        int ans = 0;
        for (int i = 0; i < n; i++) {
            int sum = 0;
            for (int j = 0; j < m; j++) {
                int k = sc.nextInt();
                sum += b.get(j) * k;
            }
            sum += c;
            if (sum > 0) {
                ans++;
            }
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int c = sc.nextInt();
        List<Integer> b = new ArrayList<>();
        for (int i = 0; i < m; i++) {
            b.add(sc.nextInt());
        }
        int ans = 0;
        for (int i = 0; i < n; i++) {
            int sum = 0;
            for (int j = 0; j < m; j++) {
                int k = sc.nextInt();
                sum += b.get(j) * k;
            }
            sum += c;
            if (sum > 0) {
                ans++;
            }
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int c = sc.nextInt();
        List<Integer> b = new ArrayList<>();
        for (int i = 0; i < m; i++) {
            b.add(sc.nextInt());
        }
        int ans = 0;
        for (int i = 0; i < n; i++) {
            int sum = 0;
            for (int j = 0; j < m; j++) {
                int k = sc.nextInt();
                sum += b.get(j) * k;
            }
            sum += c;
            if (sum > 0) {
                ans++;
            }
        }
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc int c = sc.nextInt(); c sc.nextInt() sc.nextInt sc List<Integer> b = new ArrayList<>(); b new ArrayList<>() for (int i = 0; i < m; i++) {
            b.add(sc.nextInt());
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            b.add(sc.nextInt());
        } {
            b.add(sc.nextInt());
        } b.add(sc.nextInt()) b.add b sc.nextInt() sc.nextInt sc int ans = 0; ans 0 for (int i = 0; i < n; i++) {
            int sum = 0;
            for (int j = 0; j < m; j++) {
                int k = sc.nextInt();
                sum += b.get(j) * k;
            }
            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; j < m; j++) {
                int k = sc.nextInt();
                sum += b.get(j) * k;
            }
            sum += c;
            if (sum > 0) {
                ans++;
            }
        } {
            int sum = 0;
            for (int j = 0; j < m; j++) {
                int k = sc.nextInt();
                sum += b.get(j) * k;
            }
            sum += c;
            if (sum > 0) {
                ans++;
            }
        } int sum = 0; sum 0 for (int j = 0; j < m; j++) {
                int k = sc.nextInt();
                sum += b.get(j) * k;
            } int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
                int k = sc.nextInt();
                sum += b.get(j) * k;
            } {
                int k = sc.nextInt();
                sum += b.get(j) * k;
            } int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc sum += b.get(j) * k sum b.get(j) * k b.get(j) b.get b j k sum += c sum c if (sum > 0) {
                ans++;
            } sum > 0 sum 0 {
                ans++;
            } ans++ ans System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int c = sc.nextInt();
        List<Integer> b = new ArrayList<>();
        for (int i = 0; i < m; i++) {
            b.add(sc.nextInt());
        }
        int ans = 0;
        for (int i = 0; i < n; i++) {
            int sum = 0;
            for (int j = 0; j < m; j++) {
                int k = sc.nextInt();
                sum += b.get(j) * k;
            }
            sum += c;
            if (sum > 0) {
                ans++;
            }
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int c = sc.nextInt();
        List<Integer> b = new ArrayList<>();
        for (int i = 0; i < m; i++) {
            b.add(sc.nextInt());
        }
        int ans = 0;
        for (int i = 0; i < n; i++) {
            int sum = 0;
            for (int j = 0; j < m; j++) {
                int k = sc.nextInt();
                sum += b.get(j) * k;
            }
            sum += c;
            if (sum > 0) {
                ans++;
            }
        }
        System.out.println(ans);
    }
} Main
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int c = sc.nextInt();
        List<Integer> b = new ArrayList<>();
        for (int i = 0; i < m; i++) {
            b.add(sc.nextInt());
        }
        int ans = 0;
        for (int i = 0; i < n; i++) {
            int sum = 0;
            for (int j = 0; j < m; j++) {
                int k = sc.nextInt();
                sum += b.get(j) * k;
            }
            sum += c;
            if (sum > 0) {
                ans++;
            }
        }
        System.out.println(ans);
    }
}
