import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner console = new Scanner(System.in);

        int n = console.nextInt();
        int m = console.nextInt();
        int c = console.nextInt();
        console.nextLine();

        int listB[];
        listB = new int[m];
        for(int i = 0; i < m; i++){
            listB[i] = console.nextInt();
        }
        console.nextLine();

        int listA[][];
        listA = new int[n][m];
        for(int i = 0; i < n; i++){
            for(int j = 0; j < m; j++){
                listA[i][j] = console.nextInt();
            }
            console.nextLine();
        }

        int answer = 0;
        for(int i = 0; i < n; i++){
            int num = c;
            for(int j = 0; j < m; j++){
                num += (listA[i][j] * listB[j]);
            }
            if(num > 0){
                answer++;
            }
        }
        System.out.println(answer);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner console = new Scanner(System.in);

        int n = console.nextInt();
        int m = console.nextInt();
        int c = console.nextInt();
        console.nextLine();

        int listB[];
        listB = new int[m];
        for(int i = 0; i < m; i++){
            listB[i] = console.nextInt();
        }
        console.nextLine();

        int listA[][];
        listA = new int[n][m];
        for(int i = 0; i < n; i++){
            for(int j = 0; j < m; j++){
                listA[i][j] = console.nextInt();
            }
            console.nextLine();
        }

        int answer = 0;
        for(int i = 0; i < n; i++){
            int num = c;
            for(int j = 0; j < m; j++){
                num += (listA[i][j] * listB[j]);
            }
            if(num > 0){
                answer++;
            }
        }
        System.out.println(answer);
    }
} Main public static void main(String[] args) {
        Scanner console = new Scanner(System.in);

        int n = console.nextInt();
        int m = console.nextInt();
        int c = console.nextInt();
        console.nextLine();

        int listB[];
        listB = new int[m];
        for(int i = 0; i < m; i++){
            listB[i] = console.nextInt();
        }
        console.nextLine();

        int listA[][];
        listA = new int[n][m];
        for(int i = 0; i < n; i++){
            for(int j = 0; j < m; j++){
                listA[i][j] = console.nextInt();
            }
            console.nextLine();
        }

        int answer = 0;
        for(int i = 0; i < n; i++){
            int num = c;
            for(int j = 0; j < m; j++){
                num += (listA[i][j] * listB[j]);
            }
            if(num > 0){
                answer++;
            }
        }
        System.out.println(answer);
    } main {
        Scanner console = new Scanner(System.in);

        int n = console.nextInt();
        int m = console.nextInt();
        int c = console.nextInt();
        console.nextLine();

        int listB[];
        listB = new int[m];
        for(int i = 0; i < m; i++){
            listB[i] = console.nextInt();
        }
        console.nextLine();

        int listA[][];
        listA = new int[n][m];
        for(int i = 0; i < n; i++){
            for(int j = 0; j < m; j++){
                listA[i][j] = console.nextInt();
            }
            console.nextLine();
        }

        int answer = 0;
        for(int i = 0; i < n; i++){
            int num = c;
            for(int j = 0; j < m; j++){
                num += (listA[i][j] * listB[j]);
            }
            if(num > 0){
                answer++;
            }
        }
        System.out.println(answer);
    } Scanner console = new Scanner(System.in); console new Scanner(System.in) int n = console.nextInt(); n console.nextInt() console.nextInt console int m = console.nextInt(); m console.nextInt() console.nextInt console int c = console.nextInt(); c console.nextInt() console.nextInt console console.nextLine() console.nextLine console int listB[]; listB listB = new int[m] listB new int[m] m for(int i = 0; i < m; i++){
            listB[i] = console.nextInt();
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            listB[i] = console.nextInt();
        } {
            listB[i] = console.nextInt();
        } listB[i] = console.nextInt() listB[i] listB i console.nextInt() console.nextInt console console.nextLine() console.nextLine console int listA[][]; listA listA = new int[n][m] listA new int[n][m] n m for(int i = 0; i < n; i++){
            for(int j = 0; j < m; j++){
                listA[i][j] = console.nextInt();
            }
            console.nextLine();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            for(int j = 0; j < m; j++){
                listA[i][j] = console.nextInt();
            }
            console.nextLine();
        } {
            for(int j = 0; j < m; j++){
                listA[i][j] = console.nextInt();
            }
            console.nextLine();
        } for(int j = 0; j < m; j++){
                listA[i][j] = console.nextInt();
            } int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
                listA[i][j] = console.nextInt();
            } {
                listA[i][j] = console.nextInt();
            } listA[i][j] = console.nextInt() listA[i][j] listA[i] listA i j console.nextInt() console.nextInt console console.nextLine() console.nextLine console int answer = 0; answer 0 for(int i = 0; i < n; i++){
            int num = c;
            for(int j = 0; j < m; j++){
                num += (listA[i][j] * listB[j]);
            }
            if(num > 0){
                answer++;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            int num = c;
            for(int j = 0; j < m; j++){
                num += (listA[i][j] * listB[j]);
            }
            if(num > 0){
                answer++;
            }
        } {
            int num = c;
            for(int j = 0; j < m; j++){
                num += (listA[i][j] * listB[j]);
            }
            if(num > 0){
                answer++;
            }
        } int num = c; num c for(int j = 0; j < m; j++){
                num += (listA[i][j] * listB[j]);
            } int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
                num += (listA[i][j] * listB[j]);
            } {
                num += (listA[i][j] * listB[j]);
            } num += (listA[i][j] * listB[j]) num (listA[i][j] * listB[j]) listA[i][j] listA[i] listA i j listB[j] listB j if(num > 0){
                answer++;
            } num > 0 num 0 {
                answer++;
            } answer++ answer System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {
    public static void main(String[] args) {
        Scanner console = new Scanner(System.in);

        int n = console.nextInt();
        int m = console.nextInt();
        int c = console.nextInt();
        console.nextLine();

        int listB[];
        listB = new int[m];
        for(int i = 0; i < m; i++){
            listB[i] = console.nextInt();
        }
        console.nextLine();

        int listA[][];
        listA = new int[n][m];
        for(int i = 0; i < n; i++){
            for(int j = 0; j < m; j++){
                listA[i][j] = console.nextInt();
            }
            console.nextLine();
        }

        int answer = 0;
        for(int i = 0; i < n; i++){
            int num = c;
            for(int j = 0; j < m; j++){
                num += (listA[i][j] * listB[j]);
            }
            if(num > 0){
                answer++;
            }
        }
        System.out.println(answer);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner console = new Scanner(System.in);

        int n = console.nextInt();
        int m = console.nextInt();
        int c = console.nextInt();
        console.nextLine();

        int listB[];
        listB = new int[m];
        for(int i = 0; i < m; i++){
            listB[i] = console.nextInt();
        }
        console.nextLine();

        int listA[][];
        listA = new int[n][m];
        for(int i = 0; i < n; i++){
            for(int j = 0; j < m; j++){
                listA[i][j] = console.nextInt();
            }
            console.nextLine();
        }

        int answer = 0;
        for(int i = 0; i < n; i++){
            int num = c;
            for(int j = 0; j < m; j++){
                num += (listA[i][j] * listB[j]);
            }
            if(num > 0){
                answer++;
            }
        }
        System.out.println(answer);
    }
} Main
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner console = new Scanner(System.in);

        int n = console.nextInt();
        int m = console.nextInt();
        int c = console.nextInt();
        console.nextLine();

        int listB[];
        listB = new int[m];
        for(int i = 0; i < m; i++){
            listB[i] = console.nextInt();
        }
        console.nextLine();

        int listA[][];
        listA = new int[n][m];
        for(int i = 0; i < n; i++){
            for(int j = 0; j < m; j++){
                listA[i][j] = console.nextInt();
            }
            console.nextLine();
        }

        int answer = 0;
        for(int i = 0; i < n; i++){
            int num = c;
            for(int j = 0; j < m; j++){
                num += (listA[i][j] * listB[j]);
            }
            if(num > 0){
                answer++;
            }
        }
        System.out.println(answer);
    }
}
