import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner sn = new Scanner(System.in);
        int n = sn.nextInt();
        int m = sn.nextInt();
        int c = sn.nextInt();
        
        List<Integer> blist = new ArrayList<>();
        for (int i = 0; i < m; i++){
            blist.add(sn.nextInt());
        }
        
        int resultCount = 0;
        for (int j = 1; j <= n; j++){
            int correct = 0;
            for (int i = 0; i < m; i++){
                int a = sn.nextInt();
                correct = correct + blist.get(i) * a;
            }
            correct += c;
            if(correct > 0) {
                resultCount++;
            }
        }
        System.out.println(resultCount);
    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {

        Scanner sn = new Scanner(System.in);
        int n = sn.nextInt();
        int m = sn.nextInt();
        int c = sn.nextInt();
        
        List<Integer> blist = new ArrayList<>();
        for (int i = 0; i < m; i++){
            blist.add(sn.nextInt());
        }
        
        int resultCount = 0;
        for (int j = 1; j <= n; j++){
            int correct = 0;
            for (int i = 0; i < m; i++){
                int a = sn.nextInt();
                correct = correct + blist.get(i) * a;
            }
            correct += c;
            if(correct > 0) {
                resultCount++;
            }
        }
        System.out.println(resultCount);
    }
} Main public static void main(String[] args) {

        Scanner sn = new Scanner(System.in);
        int n = sn.nextInt();
        int m = sn.nextInt();
        int c = sn.nextInt();
        
        List<Integer> blist = new ArrayList<>();
        for (int i = 0; i < m; i++){
            blist.add(sn.nextInt());
        }
        
        int resultCount = 0;
        for (int j = 1; j <= n; j++){
            int correct = 0;
            for (int i = 0; i < m; i++){
                int a = sn.nextInt();
                correct = correct + blist.get(i) * a;
            }
            correct += c;
            if(correct > 0) {
                resultCount++;
            }
        }
        System.out.println(resultCount);
    } main {

        Scanner sn = new Scanner(System.in);
        int n = sn.nextInt();
        int m = sn.nextInt();
        int c = sn.nextInt();
        
        List<Integer> blist = new ArrayList<>();
        for (int i = 0; i < m; i++){
            blist.add(sn.nextInt());
        }
        
        int resultCount = 0;
        for (int j = 1; j <= n; j++){
            int correct = 0;
            for (int i = 0; i < m; i++){
                int a = sn.nextInt();
                correct = correct + blist.get(i) * a;
            }
            correct += c;
            if(correct > 0) {
                resultCount++;
            }
        }
        System.out.println(resultCount);
    } Scanner sn = new Scanner(System.in); sn new Scanner(System.in) int n = sn.nextInt(); n sn.nextInt() sn.nextInt sn int m = sn.nextInt(); m sn.nextInt() sn.nextInt sn int c = sn.nextInt(); c sn.nextInt() sn.nextInt sn List<Integer> blist = new ArrayList<>(); blist new ArrayList<>() for (int i = 0; i < m; i++){
            blist.add(sn.nextInt());
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            blist.add(sn.nextInt());
        } {
            blist.add(sn.nextInt());
        } blist.add(sn.nextInt()) blist.add blist sn.nextInt() sn.nextInt sn int resultCount = 0; resultCount 0 for (int j = 1; j <= n; j++){
            int correct = 0;
            for (int i = 0; i < m; i++){
                int a = sn.nextInt();
                correct = correct + blist.get(i) * a;
            }
            correct += c;
            if(correct > 0) {
                resultCount++;
            }
        } int j = 1; int j = 1; j 1 j <= n j n j++ j++ j {
            int correct = 0;
            for (int i = 0; i < m; i++){
                int a = sn.nextInt();
                correct = correct + blist.get(i) * a;
            }
            correct += c;
            if(correct > 0) {
                resultCount++;
            }
        } {
            int correct = 0;
            for (int i = 0; i < m; i++){
                int a = sn.nextInt();
                correct = correct + blist.get(i) * a;
            }
            correct += c;
            if(correct > 0) {
                resultCount++;
            }
        } int correct = 0; correct 0 for (int i = 0; i < m; i++){
                int a = sn.nextInt();
                correct = correct + blist.get(i) * a;
            } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
                int a = sn.nextInt();
                correct = correct + blist.get(i) * a;
            } {
                int a = sn.nextInt();
                correct = correct + blist.get(i) * a;
            } int a = sn.nextInt(); a sn.nextInt() sn.nextInt sn correct = correct + blist.get(i) * a correct correct + blist.get(i) * a correct blist.get(i) * a blist.get(i) blist.get blist i a correct += c correct c if(correct > 0) {
                resultCount++;
            } correct > 0 correct 0 {
                resultCount++;
            } resultCount++ resultCount System.out.println(resultCount) System.out.println System.out System System.out resultCount String[] args args public class Main {

    public static void main(String[] args) {

        Scanner sn = new Scanner(System.in);
        int n = sn.nextInt();
        int m = sn.nextInt();
        int c = sn.nextInt();
        
        List<Integer> blist = new ArrayList<>();
        for (int i = 0; i < m; i++){
            blist.add(sn.nextInt());
        }
        
        int resultCount = 0;
        for (int j = 1; j <= n; j++){
            int correct = 0;
            for (int i = 0; i < m; i++){
                int a = sn.nextInt();
                correct = correct + blist.get(i) * a;
            }
            correct += c;
            if(correct > 0) {
                resultCount++;
            }
        }
        System.out.println(resultCount);
    }
} public class Main {

    public static void main(String[] args) {

        Scanner sn = new Scanner(System.in);
        int n = sn.nextInt();
        int m = sn.nextInt();
        int c = sn.nextInt();
        
        List<Integer> blist = new ArrayList<>();
        for (int i = 0; i < m; i++){
            blist.add(sn.nextInt());
        }
        
        int resultCount = 0;
        for (int j = 1; j <= n; j++){
            int correct = 0;
            for (int i = 0; i < m; i++){
                int a = sn.nextInt();
                correct = correct + blist.get(i) * a;
            }
            correct += c;
            if(correct > 0) {
                resultCount++;
            }
        }
        System.out.println(resultCount);
    }
} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner sn = new Scanner(System.in);
        int n = sn.nextInt();
        int m = sn.nextInt();
        int c = sn.nextInt();
        
        List<Integer> blist = new ArrayList<>();
        for (int i = 0; i < m; i++){
            blist.add(sn.nextInt());
        }
        
        int resultCount = 0;
        for (int j = 1; j <= n; j++){
            int correct = 0;
            for (int i = 0; i < m; i++){
                int a = sn.nextInt();
                correct = correct + blist.get(i) * a;
            }
            correct += c;
            if(correct > 0) {
                resultCount++;
            }
        }
        System.out.println(resultCount);
    }
}