import java.io.*;

class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
        int[] NMC = new int[3];
        int cont = 0;
        for (String s:str.split(" ")){
            NMC[cont] = Integer.parseInt(s);
            cont++;
        }
        str = br.readLine();
        int[] B =new int[NMC[1]];
        cont = 0;
        for (String s:str.split(" ")){
            B[cont] = Integer.parseInt(s);
            cont++;
        }
        int res;
        int ans = 0;
        for (int i=0;i<NMC[0];i++){
            str = br.readLine();
            res = 0;
            cont = 0;
            for (String s:str.split(" ")){
                res += Integer.parseInt(s) * B[cont];
                cont++;
            }
            res += NMC[2];
            if (res>0){
                ans++;
            }
        }
        System.out.println(ans);
    }
} import java.io.*; io.* java class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
        int[] NMC = new int[3];
        int cont = 0;
        for (String s:str.split(" ")){
            NMC[cont] = Integer.parseInt(s);
            cont++;
        }
        str = br.readLine();
        int[] B =new int[NMC[1]];
        cont = 0;
        for (String s:str.split(" ")){
            B[cont] = Integer.parseInt(s);
            cont++;
        }
        int res;
        int ans = 0;
        for (int i=0;i<NMC[0];i++){
            str = br.readLine();
            res = 0;
            cont = 0;
            for (String s:str.split(" ")){
                res += Integer.parseInt(s) * B[cont];
                cont++;
            }
            res += NMC[2];
            if (res>0){
                ans++;
            }
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
        int[] NMC = new int[3];
        int cont = 0;
        for (String s:str.split(" ")){
            NMC[cont] = Integer.parseInt(s);
            cont++;
        }
        str = br.readLine();
        int[] B =new int[NMC[1]];
        cont = 0;
        for (String s:str.split(" ")){
            B[cont] = Integer.parseInt(s);
            cont++;
        }
        int res;
        int ans = 0;
        for (int i=0;i<NMC[0];i++){
            str = br.readLine();
            res = 0;
            cont = 0;
            for (String s:str.split(" ")){
                res += Integer.parseInt(s) * B[cont];
                cont++;
            }
            res += NMC[2];
            if (res>0){
                ans++;
            }
        }
        System.out.println(ans);
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
        int[] NMC = new int[3];
        int cont = 0;
        for (String s:str.split(" ")){
            NMC[cont] = Integer.parseInt(s);
            cont++;
        }
        str = br.readLine();
        int[] B =new int[NMC[1]];
        cont = 0;
        for (String s:str.split(" ")){
            B[cont] = Integer.parseInt(s);
            cont++;
        }
        int res;
        int ans = 0;
        for (int i=0;i<NMC[0];i++){
            str = br.readLine();
            res = 0;
            cont = 0;
            for (String s:str.split(" ")){
                res += Integer.parseInt(s) * B[cont];
                cont++;
            }
            res += NMC[2];
            if (res>0){
                ans++;
            }
        }
        System.out.println(ans);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String str = br.readLine(); str br.readLine() br.readLine br int[] NMC = new int[3]; NMC new int[3] 3 int cont = 0; cont 0 for (String s:str.split(" ")){
            NMC[cont] = Integer.parseInt(s);
            cont++;
        } String s str.split(" ") str.split str " " {
            NMC[cont] = Integer.parseInt(s);
            cont++;
        } {
            NMC[cont] = Integer.parseInt(s);
            cont++;
        } NMC[cont] = Integer.parseInt(s) NMC[cont] NMC cont Integer.parseInt(s) Integer.parseInt Integer s cont++ cont str = br.readLine() str br.readLine() br.readLine br int[] B =new int[NMC[1]]; B new int[NMC[1]] NMC[1] NMC 1 cont = 0 cont 0 for (String s:str.split(" ")){
            B[cont] = Integer.parseInt(s);
            cont++;
        } String s str.split(" ") str.split str " " {
            B[cont] = Integer.parseInt(s);
            cont++;
        } {
            B[cont] = Integer.parseInt(s);
            cont++;
        } B[cont] = Integer.parseInt(s) B[cont] B cont Integer.parseInt(s) Integer.parseInt Integer s cont++ cont int res; res int ans = 0; ans 0 for (int i=0;i<NMC[0];i++){
            str = br.readLine();
            res = 0;
            cont = 0;
            for (String s:str.split(" ")){
                res += Integer.parseInt(s) * B[cont];
                cont++;
            }
            res += NMC[2];
            if (res>0){
                ans++;
            }
        } int i=0; int i=0; i 0 i<NMC[0] i NMC[0] NMC 0 i++ i++ i {
            str = br.readLine();
            res = 0;
            cont = 0;
            for (String s:str.split(" ")){
                res += Integer.parseInt(s) * B[cont];
                cont++;
            }
            res += NMC[2];
            if (res>0){
                ans++;
            }
        } {
            str = br.readLine();
            res = 0;
            cont = 0;
            for (String s:str.split(" ")){
                res += Integer.parseInt(s) * B[cont];
                cont++;
            }
            res += NMC[2];
            if (res>0){
                ans++;
            }
        } str = br.readLine() str br.readLine() br.readLine br res = 0 res 0 cont = 0 cont 0 for (String s:str.split(" ")){
                res += Integer.parseInt(s) * B[cont];
                cont++;
            } String s str.split(" ") str.split str " " {
                res += Integer.parseInt(s) * B[cont];
                cont++;
            } {
                res += Integer.parseInt(s) * B[cont];
                cont++;
            } res += Integer.parseInt(s) * B[cont] res Integer.parseInt(s) * B[cont] Integer.parseInt(s) Integer.parseInt Integer s B[cont] B cont cont++ cont res += NMC[2] res NMC[2] NMC 2 if (res>0){
                ans++;
            } res>0 res 0 {
                ans++;
            } ans++ ans System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.io.*;

class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
        int[] NMC = new int[3];
        int cont = 0;
        for (String s:str.split(" ")){
            NMC[cont] = Integer.parseInt(s);
            cont++;
        }
        str = br.readLine();
        int[] B =new int[NMC[1]];
        cont = 0;
        for (String s:str.split(" ")){
            B[cont] = Integer.parseInt(s);
            cont++;
        }
        int res;
        int ans = 0;
        for (int i=0;i<NMC[0];i++){
            str = br.readLine();
            res = 0;
            cont = 0;
            for (String s:str.split(" ")){
                res += Integer.parseInt(s) * B[cont];
                cont++;
            }
            res += NMC[2];
            if (res>0){
                ans++;
            }
        }
        System.out.println(ans);
    }
}