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> bList = new ArrayList<>(m);
        for (int i = 0; i < m; i++){
            int h = sc.nextInt();
            bList.add(h);
        }
        List<List<Integer>> aList = new ArrayList<>(n);
        for (int i = 0; i < n; i++){
            List<Integer> aRow = new ArrayList<>(m);
            for (int j = 0; j < m; j ++){
                aRow.add(sc.nextInt());
            }
            aList.add(aRow);
        }

        int seitou = 0;
        for (int i = 0; i < n; i++){
            if (largerThanC(aList.get(i), bList, c, m)){
                seitou += 1;
            }
        }

        System.out.println(seitou);
    }

    private static boolean largerThanC(List<Integer> aRow, List<Integer> bList, int c, int m){
        int sum = 0;
        for(int j = 0; j < m; j++){
            sum += aRow.get(j) * bList.get(j);
        }
        return sum + c > 0;
    }
} 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> bList = new ArrayList<>(m);
        for (int i = 0; i < m; i++){
            int h = sc.nextInt();
            bList.add(h);
        }
        List<List<Integer>> aList = new ArrayList<>(n);
        for (int i = 0; i < n; i++){
            List<Integer> aRow = new ArrayList<>(m);
            for (int j = 0; j < m; j ++){
                aRow.add(sc.nextInt());
            }
            aList.add(aRow);
        }

        int seitou = 0;
        for (int i = 0; i < n; i++){
            if (largerThanC(aList.get(i), bList, c, m)){
                seitou += 1;
            }
        }

        System.out.println(seitou);
    }

    private static boolean largerThanC(List<Integer> aRow, List<Integer> bList, int c, int m){
        int sum = 0;
        for(int j = 0; j < m; j++){
            sum += aRow.get(j) * bList.get(j);
        }
        return sum + c > 0;
    }
} 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> bList = new ArrayList<>(m);
        for (int i = 0; i < m; i++){
            int h = sc.nextInt();
            bList.add(h);
        }
        List<List<Integer>> aList = new ArrayList<>(n);
        for (int i = 0; i < n; i++){
            List<Integer> aRow = new ArrayList<>(m);
            for (int j = 0; j < m; j ++){
                aRow.add(sc.nextInt());
            }
            aList.add(aRow);
        }

        int seitou = 0;
        for (int i = 0; i < n; i++){
            if (largerThanC(aList.get(i), bList, c, m)){
                seitou += 1;
            }
        }

        System.out.println(seitou);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m =  sc.nextInt();
        int c = sc.nextInt();

        List<Integer> bList = new ArrayList<>(m);
        for (int i = 0; i < m; i++){
            int h = sc.nextInt();
            bList.add(h);
        }
        List<List<Integer>> aList = new ArrayList<>(n);
        for (int i = 0; i < n; i++){
            List<Integer> aRow = new ArrayList<>(m);
            for (int j = 0; j < m; j ++){
                aRow.add(sc.nextInt());
            }
            aList.add(aRow);
        }

        int seitou = 0;
        for (int i = 0; i < n; i++){
            if (largerThanC(aList.get(i), bList, c, m)){
                seitou += 1;
            }
        }

        System.out.println(seitou);
    } 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> bList = new ArrayList<>(m); bList new ArrayList<>(m) for (int i = 0; i < m; i++){
            int h = sc.nextInt();
            bList.add(h);
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            int h = sc.nextInt();
            bList.add(h);
        } {
            int h = sc.nextInt();
            bList.add(h);
        } int h = sc.nextInt(); h sc.nextInt() sc.nextInt sc bList.add(h) bList.add bList h List<List<Integer>> aList = new ArrayList<>(n); aList new ArrayList<>(n) for (int i = 0; i < n; i++){
            List<Integer> aRow = new ArrayList<>(m);
            for (int j = 0; j < m; j ++){
                aRow.add(sc.nextInt());
            }
            aList.add(aRow);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            List<Integer> aRow = new ArrayList<>(m);
            for (int j = 0; j < m; j ++){
                aRow.add(sc.nextInt());
            }
            aList.add(aRow);
        } {
            List<Integer> aRow = new ArrayList<>(m);
            for (int j = 0; j < m; j ++){
                aRow.add(sc.nextInt());
            }
            aList.add(aRow);
        } List<Integer> aRow = new ArrayList<>(m); aRow new ArrayList<>(m) for (int j = 0; j < m; j ++){
                aRow.add(sc.nextInt());
            } int j = 0; int j = 0; j 0 j < m j m j ++ j ++ j {
                aRow.add(sc.nextInt());
            } {
                aRow.add(sc.nextInt());
            } aRow.add(sc.nextInt()) aRow.add aRow sc.nextInt() sc.nextInt sc aList.add(aRow) aList.add aList aRow int seitou = 0; seitou 0 for (int i = 0; i < n; i++){
            if (largerThanC(aList.get(i), bList, c, m)){
                seitou += 1;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            if (largerThanC(aList.get(i), bList, c, m)){
                seitou += 1;
            }
        } {
            if (largerThanC(aList.get(i), bList, c, m)){
                seitou += 1;
            }
        } if (largerThanC(aList.get(i), bList, c, m)){
                seitou += 1;
            } largerThanC(aList.get(i), bList, c, m) largerThanC aList.get(i) aList.get aList i bList c m {
                seitou += 1;
            } seitou += 1 seitou 1 System.out.println(seitou) System.out.println System.out System System.out seitou String[] args args private static boolean largerThanC(List<Integer> aRow, List<Integer> bList, int c, int m){
        int sum = 0;
        for(int j = 0; j < m; j++){
            sum += aRow.get(j) * bList.get(j);
        }
        return sum + c > 0;
    } largerThanC {
        int sum = 0;
        for(int j = 0; j < m; j++){
            sum += aRow.get(j) * bList.get(j);
        }
        return sum + c > 0;
    } int sum = 0; sum 0 for(int j = 0; j < m; j++){
            sum += aRow.get(j) * bList.get(j);
        } int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
            sum += aRow.get(j) * bList.get(j);
        } {
            sum += aRow.get(j) * bList.get(j);
        } sum += aRow.get(j) * bList.get(j) sum aRow.get(j) * bList.get(j) aRow.get(j) aRow.get aRow j bList.get(j) bList.get bList j return sum + c > 0; sum + c > 0 sum + c sum c 0 List<Integer> aRow aRow List<Integer> bList bList int c c int m m 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> bList = new ArrayList<>(m);
        for (int i = 0; i < m; i++){
            int h = sc.nextInt();
            bList.add(h);
        }
        List<List<Integer>> aList = new ArrayList<>(n);
        for (int i = 0; i < n; i++){
            List<Integer> aRow = new ArrayList<>(m);
            for (int j = 0; j < m; j ++){
                aRow.add(sc.nextInt());
            }
            aList.add(aRow);
        }

        int seitou = 0;
        for (int i = 0; i < n; i++){
            if (largerThanC(aList.get(i), bList, c, m)){
                seitou += 1;
            }
        }

        System.out.println(seitou);
    }

    private static boolean largerThanC(List<Integer> aRow, List<Integer> bList, int c, int m){
        int sum = 0;
        for(int j = 0; j < m; j++){
            sum += aRow.get(j) * bList.get(j);
        }
        return sum + c > 0;
    }
} 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> bList = new ArrayList<>(m);
        for (int i = 0; i < m; i++){
            int h = sc.nextInt();
            bList.add(h);
        }
        List<List<Integer>> aList = new ArrayList<>(n);
        for (int i = 0; i < n; i++){
            List<Integer> aRow = new ArrayList<>(m);
            for (int j = 0; j < m; j ++){
                aRow.add(sc.nextInt());
            }
            aList.add(aRow);
        }

        int seitou = 0;
        for (int i = 0; i < n; i++){
            if (largerThanC(aList.get(i), bList, c, m)){
                seitou += 1;
            }
        }

        System.out.println(seitou);
    }

    private static boolean largerThanC(List<Integer> aRow, List<Integer> bList, int c, int m){
        int sum = 0;
        for(int j = 0; j < m; j++){
            sum += aRow.get(j) * bList.get(j);
        }
        return sum + c > 0;
    }
} 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> bList = new ArrayList<>(m);
        for (int i = 0; i < m; i++){
            int h = sc.nextInt();
            bList.add(h);
        }
        List<List<Integer>> aList = new ArrayList<>(n);
        for (int i = 0; i < n; i++){
            List<Integer> aRow = new ArrayList<>(m);
            for (int j = 0; j < m; j ++){
                aRow.add(sc.nextInt());
            }
            aList.add(aRow);
        }

        int seitou = 0;
        for (int i = 0; i < n; i++){
            if (largerThanC(aList.get(i), bList, c, m)){
                seitou += 1;
            }
        }

        System.out.println(seitou);
    }

    private static boolean largerThanC(List<Integer> aRow, List<Integer> bList, int c, int m){
        int sum = 0;
        for(int j = 0; j < m; j++){
            sum += aRow.get(j) * bList.get(j);
        }
        return sum + c > 0;
    }
}