import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String in[], bin[];
        int row, col, c, res, ret;
        in = scanner.nextLine().split(" ");
        row = Integer.parseInt(in[0]);
        col = Integer.parseInt(in[1]);
        c = Integer.parseInt(in[2]);

        bin = scanner.nextLine().split(" ");
        ret = 0;
        for (int i = 0; i < row; i++) {
            in = scanner.nextLine().split(" ");
            res = c;
            for (int j = 0; j < col; j++) {
                res += Integer.parseInt(in[j]) * Integer.parseInt(bin[j]);
            }
            if (res > 0) {
                ret++;
            }
        }
        System.out.println(ret);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String in[], bin[];
        int row, col, c, res, ret;
        in = scanner.nextLine().split(" ");
        row = Integer.parseInt(in[0]);
        col = Integer.parseInt(in[1]);
        c = Integer.parseInt(in[2]);

        bin = scanner.nextLine().split(" ");
        ret = 0;
        for (int i = 0; i < row; i++) {
            in = scanner.nextLine().split(" ");
            res = c;
            for (int j = 0; j < col; j++) {
                res += Integer.parseInt(in[j]) * Integer.parseInt(bin[j]);
            }
            if (res > 0) {
                ret++;
            }
        }
        System.out.println(ret);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String in[], bin[];
        int row, col, c, res, ret;
        in = scanner.nextLine().split(" ");
        row = Integer.parseInt(in[0]);
        col = Integer.parseInt(in[1]);
        c = Integer.parseInt(in[2]);

        bin = scanner.nextLine().split(" ");
        ret = 0;
        for (int i = 0; i < row; i++) {
            in = scanner.nextLine().split(" ");
            res = c;
            for (int j = 0; j < col; j++) {
                res += Integer.parseInt(in[j]) * Integer.parseInt(bin[j]);
            }
            if (res > 0) {
                ret++;
            }
        }
        System.out.println(ret);
    } main {
        Scanner scanner = new Scanner(System.in);
        String in[], bin[];
        int row, col, c, res, ret;
        in = scanner.nextLine().split(" ");
        row = Integer.parseInt(in[0]);
        col = Integer.parseInt(in[1]);
        c = Integer.parseInt(in[2]);

        bin = scanner.nextLine().split(" ");
        ret = 0;
        for (int i = 0; i < row; i++) {
            in = scanner.nextLine().split(" ");
            res = c;
            for (int j = 0; j < col; j++) {
                res += Integer.parseInt(in[j]) * Integer.parseInt(bin[j]);
            }
            if (res > 0) {
                ret++;
            }
        }
        System.out.println(ret);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String in[] in bin[]; bin int row row col col c c res res ret; ret in = scanner.nextLine().split(" ") in scanner.nextLine().split(" ") scanner.nextLine().split scanner.nextLine() scanner.nextLine scanner " " row = Integer.parseInt(in[0]) row Integer.parseInt(in[0]) Integer.parseInt Integer in[0] in 0 col = Integer.parseInt(in[1]) col Integer.parseInt(in[1]) Integer.parseInt Integer in[1] in 1 c = Integer.parseInt(in[2]) c Integer.parseInt(in[2]) Integer.parseInt Integer in[2] in 2 bin = scanner.nextLine().split(" ") bin scanner.nextLine().split(" ") scanner.nextLine().split scanner.nextLine() scanner.nextLine scanner " " ret = 0 ret 0 for (int i = 0; i < row; i++) {
            in = scanner.nextLine().split(" ");
            res = c;
            for (int j = 0; j < col; j++) {
                res += Integer.parseInt(in[j]) * Integer.parseInt(bin[j]);
            }
            if (res > 0) {
                ret++;
            }
        } int i = 0; int i = 0; i 0 i < row i row i++ i++ i {
            in = scanner.nextLine().split(" ");
            res = c;
            for (int j = 0; j < col; j++) {
                res += Integer.parseInt(in[j]) * Integer.parseInt(bin[j]);
            }
            if (res > 0) {
                ret++;
            }
        } {
            in = scanner.nextLine().split(" ");
            res = c;
            for (int j = 0; j < col; j++) {
                res += Integer.parseInt(in[j]) * Integer.parseInt(bin[j]);
            }
            if (res > 0) {
                ret++;
            }
        } in = scanner.nextLine().split(" ") in scanner.nextLine().split(" ") scanner.nextLine().split scanner.nextLine() scanner.nextLine scanner " " res = c res c for (int j = 0; j < col; j++) {
                res += Integer.parseInt(in[j]) * Integer.parseInt(bin[j]);
            } int j = 0; int j = 0; j 0 j < col j col j++ j++ j {
                res += Integer.parseInt(in[j]) * Integer.parseInt(bin[j]);
            } {
                res += Integer.parseInt(in[j]) * Integer.parseInt(bin[j]);
            } res += Integer.parseInt(in[j]) * Integer.parseInt(bin[j]) res Integer.parseInt(in[j]) * Integer.parseInt(bin[j]) Integer.parseInt(in[j]) Integer.parseInt Integer in[j] in j Integer.parseInt(bin[j]) Integer.parseInt Integer bin[j] bin j if (res > 0) {
                ret++;
            } res > 0 res 0 {
                ret++;
            } ret++ ret System.out.println(ret) System.out.println System.out System System.out ret String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String in[], bin[];
        int row, col, c, res, ret;
        in = scanner.nextLine().split(" ");
        row = Integer.parseInt(in[0]);
        col = Integer.parseInt(in[1]);
        c = Integer.parseInt(in[2]);

        bin = scanner.nextLine().split(" ");
        ret = 0;
        for (int i = 0; i < row; i++) {
            in = scanner.nextLine().split(" ");
            res = c;
            for (int j = 0; j < col; j++) {
                res += Integer.parseInt(in[j]) * Integer.parseInt(bin[j]);
            }
            if (res > 0) {
                ret++;
            }
        }
        System.out.println(ret);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String in[], bin[];
        int row, col, c, res, ret;
        in = scanner.nextLine().split(" ");
        row = Integer.parseInt(in[0]);
        col = Integer.parseInt(in[1]);
        c = Integer.parseInt(in[2]);

        bin = scanner.nextLine().split(" ");
        ret = 0;
        for (int i = 0; i < row; i++) {
            in = scanner.nextLine().split(" ");
            res = c;
            for (int j = 0; j < col; j++) {
                res += Integer.parseInt(in[j]) * Integer.parseInt(bin[j]);
            }
            if (res > 0) {
                ret++;
            }
        }
        System.out.println(ret);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String in[], bin[];
        int row, col, c, res, ret;
        in = scanner.nextLine().split(" ");
        row = Integer.parseInt(in[0]);
        col = Integer.parseInt(in[1]);
        c = Integer.parseInt(in[2]);

        bin = scanner.nextLine().split(" ");
        ret = 0;
        for (int i = 0; i < row; i++) {
            in = scanner.nextLine().split(" ");
            res = c;
            for (int j = 0; j < col; j++) {
                res += Integer.parseInt(in[j]) * Integer.parseInt(bin[j]);
            }
            if (res > 0) {
                ret++;
            }
        }
        System.out.println(ret);
    }
}