import java.util.*;

class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int codeNum = sc.nextInt();
        int statusNum = sc.nextInt();
        int passScore = -sc.nextInt();

        int[] coefficient = new int[statusNum];
        for(int i  = 0; i < statusNum; i++)coefficient[i] = sc.nextInt();
        
        int ans = 0;
        for(int i = 0; i < codeNum; i++){
            int score = 0;
            for(int j  = 0; j < statusNum; j++){
                score += coefficient[j] * sc.nextInt();
            }
            if(score > passScore)ans++;
        }

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

        int codeNum = sc.nextInt();
        int statusNum = sc.nextInt();
        int passScore = -sc.nextInt();

        int[] coefficient = new int[statusNum];
        for(int i  = 0; i < statusNum; i++)coefficient[i] = sc.nextInt();
        
        int ans = 0;
        for(int i = 0; i < codeNum; i++){
            int score = 0;
            for(int j  = 0; j < statusNum; j++){
                score += coefficient[j] * sc.nextInt();
            }
            if(score > passScore)ans++;
        }

        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int codeNum = sc.nextInt();
        int statusNum = sc.nextInt();
        int passScore = -sc.nextInt();

        int[] coefficient = new int[statusNum];
        for(int i  = 0; i < statusNum; i++)coefficient[i] = sc.nextInt();
        
        int ans = 0;
        for(int i = 0; i < codeNum; i++){
            int score = 0;
            for(int j  = 0; j < statusNum; j++){
                score += coefficient[j] * sc.nextInt();
            }
            if(score > passScore)ans++;
        }

        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);

        int codeNum = sc.nextInt();
        int statusNum = sc.nextInt();
        int passScore = -sc.nextInt();

        int[] coefficient = new int[statusNum];
        for(int i  = 0; i < statusNum; i++)coefficient[i] = sc.nextInt();
        
        int ans = 0;
        for(int i = 0; i < codeNum; i++){
            int score = 0;
            for(int j  = 0; j < statusNum; j++){
                score += coefficient[j] * sc.nextInt();
            }
            if(score > passScore)ans++;
        }

        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int codeNum = sc.nextInt(); codeNum sc.nextInt() sc.nextInt sc int statusNum = sc.nextInt(); statusNum sc.nextInt() sc.nextInt sc int passScore = -sc.nextInt(); passScore -sc.nextInt() sc.nextInt() sc.nextInt sc int[] coefficient = new int[statusNum]; coefficient new int[statusNum] statusNum for(int i  = 0; i < statusNum; i++)coefficient[i] = sc.nextInt(); int i  = 0; int i  = 0; i 0 i < statusNum i statusNum i++ i++ i coefficient[i] = sc.nextInt(); coefficient[i] = sc.nextInt() coefficient[i] coefficient i sc.nextInt() sc.nextInt sc int ans = 0; ans 0 for(int i = 0; i < codeNum; i++){
            int score = 0;
            for(int j  = 0; j < statusNum; j++){
                score += coefficient[j] * sc.nextInt();
            }
            if(score > passScore)ans++;
        } int i = 0; int i = 0; i 0 i < codeNum i codeNum i++ i++ i {
            int score = 0;
            for(int j  = 0; j < statusNum; j++){
                score += coefficient[j] * sc.nextInt();
            }
            if(score > passScore)ans++;
        } {
            int score = 0;
            for(int j  = 0; j < statusNum; j++){
                score += coefficient[j] * sc.nextInt();
            }
            if(score > passScore)ans++;
        } int score = 0; score 0 for(int j  = 0; j < statusNum; j++){
                score += coefficient[j] * sc.nextInt();
            } int j  = 0; int j  = 0; j 0 j < statusNum j statusNum j++ j++ j {
                score += coefficient[j] * sc.nextInt();
            } {
                score += coefficient[j] * sc.nextInt();
            } score += coefficient[j] * sc.nextInt() score coefficient[j] * sc.nextInt() coefficient[j] coefficient j sc.nextInt() sc.nextInt sc if(score > passScore)ans++; score > passScore score passScore ans++ ans System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.*;

class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int codeNum = sc.nextInt();
        int statusNum = sc.nextInt();
        int passScore = -sc.nextInt();

        int[] coefficient = new int[statusNum];
        for(int i  = 0; i < statusNum; i++)coefficient[i] = sc.nextInt();
        
        int ans = 0;
        for(int i = 0; i < codeNum; i++){
            int score = 0;
            for(int j  = 0; j < statusNum; j++){
                score += coefficient[j] * sc.nextInt();
            }
            if(score > passScore)ans++;
        }

        System.out.println(ans);
    }
}