import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt(),
            M = sc.nextInt(),
            C = sc.nextInt(),
            correct = 0;
        int[] B = new int[M];
        for(int i = 0; i < M; i++){
            B[i] = sc.nextInt();
        }
        for(int i = 0; i < N; i++){
            int value = C;
            for(int j = 0; j < M; j++){
                value += sc.nextInt()*B[j];
            }
            if(value > 0){
                correct++;
            }
        }
        System.out.println(correct);
    }
} import java.util.*; util.* java public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt(),
            M = sc.nextInt(),
            C = sc.nextInt(),
            correct = 0;
        int[] B = new int[M];
        for(int i = 0; i < M; i++){
            B[i] = sc.nextInt();
        }
        for(int i = 0; i < N; i++){
            int value = C;
            for(int j = 0; j < M; j++){
                value += sc.nextInt()*B[j];
            }
            if(value > 0){
                correct++;
            }
        }
        System.out.println(correct);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt(),
            M = sc.nextInt(),
            C = sc.nextInt(),
            correct = 0;
        int[] B = new int[M];
        for(int i = 0; i < M; i++){
            B[i] = sc.nextInt();
        }
        for(int i = 0; i < N; i++){
            int value = C;
            for(int j = 0; j < M; j++){
                value += sc.nextInt()*B[j];
            }
            if(value > 0){
                correct++;
            }
        }
        System.out.println(correct);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt(),
            M = sc.nextInt(),
            C = sc.nextInt(),
            correct = 0;
        int[] B = new int[M];
        for(int i = 0; i < M; i++){
            B[i] = sc.nextInt();
        }
        for(int i = 0; i < N; i++){
            int value = C;
            for(int j = 0; j < M; j++){
                value += sc.nextInt()*B[j];
            }
            if(value > 0){
                correct++;
            }
        }
        System.out.println(correct);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt() N sc.nextInt() sc.nextInt sc M = sc.nextInt() M sc.nextInt() sc.nextInt sc C = sc.nextInt() C sc.nextInt() sc.nextInt sc correct = 0; correct 0 int[] B = new int[M]; B new int[M] M for(int i = 0; i < M; i++){
            B[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
            B[i] = sc.nextInt();
        } {
            B[i] = sc.nextInt();
        } B[i] = sc.nextInt() B[i] B i sc.nextInt() sc.nextInt sc for(int i = 0; i < N; i++){
            int value = C;
            for(int j = 0; j < M; j++){
                value += sc.nextInt()*B[j];
            }
            if(value > 0){
                correct++;
            }
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            int value = C;
            for(int j = 0; j < M; j++){
                value += sc.nextInt()*B[j];
            }
            if(value > 0){
                correct++;
            }
        } {
            int value = C;
            for(int j = 0; j < M; j++){
                value += sc.nextInt()*B[j];
            }
            if(value > 0){
                correct++;
            }
        } int value = C; value C for(int j = 0; j < M; j++){
                value += sc.nextInt()*B[j];
            } int j = 0; int j = 0; j 0 j < M j M j++ j++ j {
                value += sc.nextInt()*B[j];
            } {
                value += sc.nextInt()*B[j];
            } value += sc.nextInt()*B[j] value sc.nextInt()*B[j] sc.nextInt() sc.nextInt sc B[j] B j if(value > 0){
                correct++;
            } value > 0 value 0 {
                correct++;
            } correct++ correct System.out.println(correct) System.out.println System.out System System.out correct String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt(),
            M = sc.nextInt(),
            C = sc.nextInt(),
            correct = 0;
        int[] B = new int[M];
        for(int i = 0; i < M; i++){
            B[i] = sc.nextInt();
        }
        for(int i = 0; i < N; i++){
            int value = C;
            for(int j = 0; j < M; j++){
                value += sc.nextInt()*B[j];
            }
            if(value > 0){
                correct++;
            }
        }
        System.out.println(correct);
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt(),
            M = sc.nextInt(),
            C = sc.nextInt(),
            correct = 0;
        int[] B = new int[M];
        for(int i = 0; i < M; i++){
            B[i] = sc.nextInt();
        }
        for(int i = 0; i < N; i++){
            int value = C;
            for(int j = 0; j < M; j++){
                value += sc.nextInt()*B[j];
            }
            if(value > 0){
                correct++;
            }
        }
        System.out.println(correct);
    }
} Main
import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt(),
            M = sc.nextInt(),
            C = sc.nextInt(),
            correct = 0;
        int[] B = new int[M];
        for(int i = 0; i < M; i++){
            B[i] = sc.nextInt();
        }
        for(int i = 0; i < N; i++){
            int value = C;
            for(int j = 0; j < M; j++){
                value += sc.nextInt()*B[j];
            }
            if(value > 0){
                correct++;
            }
        }
        System.out.println(correct);
    }
}