import java.util.Scanner;

public class Main{

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

        // input
        final int NUM = scan.nextInt();
        final int M = scan.nextInt();
        int[][] codes = new int[NUM][M];
        int[] rate = new int[M];
        int bonus = scan.nextInt();
        for(int i = 0; i < M; i++){
            rate[i] = scan.nextInt();
        }
        for(int i = 0; i < NUM; i++){
            for(int j = 0; j < M; j++){
                codes[i][j] = scan.nextInt();
            }
        }

        // search
        int count = 0 ;
        for(int i = 0; i < NUM; i++){
            int sum = 0;
            for(int j = 0; j < M; j++){
                sum += codes[i][j] * rate[j];
            }
            sum+= bonus;
            if(sum > 0){
                count++;
            }
        }

        // answer
        System.out.println(count);

    }
} import java.util.Scanner; Scanner java.util public class Main{

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

        // input
        final int NUM = scan.nextInt();
        final int M = scan.nextInt();
        int[][] codes = new int[NUM][M];
        int[] rate = new int[M];
        int bonus = scan.nextInt();
        for(int i = 0; i < M; i++){
            rate[i] = scan.nextInt();
        }
        for(int i = 0; i < NUM; i++){
            for(int j = 0; j < M; j++){
                codes[i][j] = scan.nextInt();
            }
        }

        // search
        int count = 0 ;
        for(int i = 0; i < NUM; i++){
            int sum = 0;
            for(int j = 0; j < M; j++){
                sum += codes[i][j] * rate[j];
            }
            sum+= bonus;
            if(sum > 0){
                count++;
            }
        }

        // answer
        System.out.println(count);

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

        // input
        final int NUM = scan.nextInt();
        final int M = scan.nextInt();
        int[][] codes = new int[NUM][M];
        int[] rate = new int[M];
        int bonus = scan.nextInt();
        for(int i = 0; i < M; i++){
            rate[i] = scan.nextInt();
        }
        for(int i = 0; i < NUM; i++){
            for(int j = 0; j < M; j++){
                codes[i][j] = scan.nextInt();
            }
        }

        // search
        int count = 0 ;
        for(int i = 0; i < NUM; i++){
            int sum = 0;
            for(int j = 0; j < M; j++){
                sum += codes[i][j] * rate[j];
            }
            sum+= bonus;
            if(sum > 0){
                count++;
            }
        }

        // answer
        System.out.println(count);

    } main {
        Scanner scan = new Scanner(System.in);

        // input
        final int NUM = scan.nextInt();
        final int M = scan.nextInt();
        int[][] codes = new int[NUM][M];
        int[] rate = new int[M];
        int bonus = scan.nextInt();
        for(int i = 0; i < M; i++){
            rate[i] = scan.nextInt();
        }
        for(int i = 0; i < NUM; i++){
            for(int j = 0; j < M; j++){
                codes[i][j] = scan.nextInt();
            }
        }

        // search
        int count = 0 ;
        for(int i = 0; i < NUM; i++){
            int sum = 0;
            for(int j = 0; j < M; j++){
                sum += codes[i][j] * rate[j];
            }
            sum+= bonus;
            if(sum > 0){
                count++;
            }
        }

        // answer
        System.out.println(count);

    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) final int NUM = scan.nextInt(); NUM scan.nextInt() scan.nextInt scan final int M = scan.nextInt(); M scan.nextInt() scan.nextInt scan int[][] codes = new int[NUM][M]; codes new int[NUM][M] NUM M int[] rate = new int[M]; rate new int[M] M int bonus = scan.nextInt(); bonus scan.nextInt() scan.nextInt scan for(int i = 0; i < M; i++){
            rate[i] = scan.nextInt();
        } int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
            rate[i] = scan.nextInt();
        } {
            rate[i] = scan.nextInt();
        } rate[i] = scan.nextInt() rate[i] rate i scan.nextInt() scan.nextInt scan for(int i = 0; i < NUM; i++){
            for(int j = 0; j < M; j++){
                codes[i][j] = scan.nextInt();
            }
        } int i = 0; int i = 0; i 0 i < NUM i NUM i++ i++ i {
            for(int j = 0; j < M; j++){
                codes[i][j] = scan.nextInt();
            }
        } {
            for(int j = 0; j < M; j++){
                codes[i][j] = scan.nextInt();
            }
        } for(int j = 0; j < M; j++){
                codes[i][j] = scan.nextInt();
            } int j = 0; int j = 0; j 0 j < M j M j++ j++ j {
                codes[i][j] = scan.nextInt();
            } {
                codes[i][j] = scan.nextInt();
            } codes[i][j] = scan.nextInt() codes[i][j] codes[i] codes i j scan.nextInt() scan.nextInt scan int count = 0 ; count 0 for(int i = 0; i < NUM; i++){
            int sum = 0;
            for(int j = 0; j < M; j++){
                sum += codes[i][j] * rate[j];
            }
            sum+= bonus;
            if(sum > 0){
                count++;
            }
        } int i = 0; int i = 0; i 0 i < NUM i NUM i++ i++ i {
            int sum = 0;
            for(int j = 0; j < M; j++){
                sum += codes[i][j] * rate[j];
            }
            sum+= bonus;
            if(sum > 0){
                count++;
            }
        } {
            int sum = 0;
            for(int j = 0; j < M; j++){
                sum += codes[i][j] * rate[j];
            }
            sum+= bonus;
            if(sum > 0){
                count++;
            }
        } int sum = 0; sum 0 for(int j = 0; j < M; j++){
                sum += codes[i][j] * rate[j];
            } int j = 0; int j = 0; j 0 j < M j M j++ j++ j {
                sum += codes[i][j] * rate[j];
            } {
                sum += codes[i][j] * rate[j];
            } sum += codes[i][j] * rate[j] sum codes[i][j] * rate[j] codes[i][j] codes[i] codes i j rate[j] rate j sum+= bonus sum bonus if(sum > 0){
                count++;
            } sum > 0 sum 0 {
                count++;
            } count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main{

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

        // input
        final int NUM = scan.nextInt();
        final int M = scan.nextInt();
        int[][] codes = new int[NUM][M];
        int[] rate = new int[M];
        int bonus = scan.nextInt();
        for(int i = 0; i < M; i++){
            rate[i] = scan.nextInt();
        }
        for(int i = 0; i < NUM; i++){
            for(int j = 0; j < M; j++){
                codes[i][j] = scan.nextInt();
            }
        }

        // search
        int count = 0 ;
        for(int i = 0; i < NUM; i++){
            int sum = 0;
            for(int j = 0; j < M; j++){
                sum += codes[i][j] * rate[j];
            }
            sum+= bonus;
            if(sum > 0){
                count++;
            }
        }

        // answer
        System.out.println(count);

    }
} public class Main{

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

        // input
        final int NUM = scan.nextInt();
        final int M = scan.nextInt();
        int[][] codes = new int[NUM][M];
        int[] rate = new int[M];
        int bonus = scan.nextInt();
        for(int i = 0; i < M; i++){
            rate[i] = scan.nextInt();
        }
        for(int i = 0; i < NUM; i++){
            for(int j = 0; j < M; j++){
                codes[i][j] = scan.nextInt();
            }
        }

        // search
        int count = 0 ;
        for(int i = 0; i < NUM; i++){
            int sum = 0;
            for(int j = 0; j < M; j++){
                sum += codes[i][j] * rate[j];
            }
            sum+= bonus;
            if(sum > 0){
                count++;
            }
        }

        // answer
        System.out.println(count);

    }
} Main
import java.util.Scanner;

public class Main{

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

        // input
        final int NUM = scan.nextInt();
        final int M = scan.nextInt();
        int[][] codes = new int[NUM][M];
        int[] rate = new int[M];
        int bonus = scan.nextInt();
        for(int i = 0; i < M; i++){
            rate[i] = scan.nextInt();
        }
        for(int i = 0; i < NUM; i++){
            for(int j = 0; j < M; j++){
                codes[i][j] = scan.nextInt();
            }
        }

        // search
        int count = 0 ;
        for(int i = 0; i < NUM; i++){
            int sum = 0;
            for(int j = 0; j < M; j++){
                sum += codes[i][j] * rate[j];
            }
            sum+= bonus;
            if(sum > 0){
                count++;
            }
        }

        // answer
        System.out.println(count);

    }
}