import java.io.*;
import java.math.*;
import java.util.*;





public class Main {

    static MyScanner in = new MyScanner();
    static   PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    int N;
    static int max = 200001;
    static int [] dr = {1,-1,0,0};
    static int [] dc={0,0,-1,1};
    public static void main(String args[]) throws IOException {
        int N = in.nextInt();
        int M = in.nextInt();
        int C = in.nextInt();
        int [] b = new int[M];
        int count =0; 
        for(int i=0;i<M;i++)
        b[i] = in.nextInt();
        for(int i=0;i<N;i++){
            long sum = 0;
            for(int j=0;j<M;j++){
                sum+=(in.nextInt()*b[j]);
            }
            if(sum+C>0){
                count++;
            }
        }
        out.println(count);

        out.flush();
        }
       static boolean isEven(long a){
            return (a&1)==0;
        }
       static  void swap (int a, int b){

        int temmp = b;
        b=a;
        a = temmp;
        }
    

    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;
   
        public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        }
   
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
   
        int nextInt() {
            return Integer.parseInt(next());
        }
   
        long nextLong() {
            return Long.parseLong(next());
        }
   
        double nextDouble() {
            return Double.parseDouble(next());
        }
   
        String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        }
  
     }
} import java.io.*; io.* java import java.math.*; math.* java import java.util.*; util.* java public class Main {

    static MyScanner in = new MyScanner();
    static   PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    int N;
    static int max = 200001;
    static int [] dr = {1,-1,0,0};
    static int [] dc={0,0,-1,1};
    public static void main(String args[]) throws IOException {
        int N = in.nextInt();
        int M = in.nextInt();
        int C = in.nextInt();
        int [] b = new int[M];
        int count =0; 
        for(int i=0;i<M;i++)
        b[i] = in.nextInt();
        for(int i=0;i<N;i++){
            long sum = 0;
            for(int j=0;j<M;j++){
                sum+=(in.nextInt()*b[j]);
            }
            if(sum+C>0){
                count++;
            }
        }
        out.println(count);

        out.flush();
        }
       static boolean isEven(long a){
            return (a&1)==0;
        }
       static  void swap (int a, int b){

        int temmp = b;
        b=a;
        a = temmp;
        }
    

    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;
   
        public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        }
   
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
   
        int nextInt() {
            return Integer.parseInt(next());
        }
   
        long nextLong() {
            return Long.parseLong(next());
        }
   
        double nextDouble() {
            return Double.parseDouble(next());
        }
   
        String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        }
  
     }
} Main static MyScanner in = new MyScanner(); in new MyScanner() static   PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out)); out new PrintWriter(new OutputStreamWriter(System.out)) int N; N static int max = 200001; max 200001 static int [] dr = {1,-1,0,0}; dr {1,-1,0,0} 1 -1 1 0 0 static int [] dc={0,0,-1,1}; dc {0,0,-1,1} 0 0 -1 1 1 public static void main(String args[]) throws IOException {
        int N = in.nextInt();
        int M = in.nextInt();
        int C = in.nextInt();
        int [] b = new int[M];
        int count =0; 
        for(int i=0;i<M;i++)
        b[i] = in.nextInt();
        for(int i=0;i<N;i++){
            long sum = 0;
            for(int j=0;j<M;j++){
                sum+=(in.nextInt()*b[j]);
            }
            if(sum+C>0){
                count++;
            }
        }
        out.println(count);

        out.flush();
        } main {
        int N = in.nextInt();
        int M = in.nextInt();
        int C = in.nextInt();
        int [] b = new int[M];
        int count =0; 
        for(int i=0;i<M;i++)
        b[i] = in.nextInt();
        for(int i=0;i<N;i++){
            long sum = 0;
            for(int j=0;j<M;j++){
                sum+=(in.nextInt()*b[j]);
            }
            if(sum+C>0){
                count++;
            }
        }
        out.println(count);

        out.flush();
        } int N = in.nextInt(); N in.nextInt() in.nextInt in int M = in.nextInt(); M in.nextInt() in.nextInt in int C = in.nextInt(); C in.nextInt() in.nextInt in int [] b = new int[M]; b new int[M] M int count =0; count 0 for(int i=0;i<M;i++)
        b[i] = in.nextInt(); int i=0; int i=0; i 0 i<M i M i++ i++ i b[i] = in.nextInt(); b[i] = in.nextInt() b[i] b i in.nextInt() in.nextInt in for(int i=0;i<N;i++){
            long sum = 0;
            for(int j=0;j<M;j++){
                sum+=(in.nextInt()*b[j]);
            }
            if(sum+C>0){
                count++;
            }
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            long sum = 0;
            for(int j=0;j<M;j++){
                sum+=(in.nextInt()*b[j]);
            }
            if(sum+C>0){
                count++;
            }
        } {
            long sum = 0;
            for(int j=0;j<M;j++){
                sum+=(in.nextInt()*b[j]);
            }
            if(sum+C>0){
                count++;
            }
        } long sum = 0; sum 0 for(int j=0;j<M;j++){
                sum+=(in.nextInt()*b[j]);
            } int j=0; int j=0; j 0 j<M j M j++ j++ j {
                sum+=(in.nextInt()*b[j]);
            } {
                sum+=(in.nextInt()*b[j]);
            } sum+=(in.nextInt()*b[j]) sum (in.nextInt()*b[j]) in.nextInt() in.nextInt in b[j] b j if(sum+C>0){
                count++;
            } sum+C>0 sum+C sum C 0 {
                count++;
            } count++ count out.println(count) out.println out count out.flush() out.flush out String args[] args static boolean isEven(long a){
            return (a&1)==0;
        } isEven {
            return (a&1)==0;
        } return (a&1)==0; (a&1)==0 (a&1) a 1 0 long a a static  void swap (int a, int b){

        int temmp = b;
        b=a;
        a = temmp;
        } swap {

        int temmp = b;
        b=a;
        a = temmp;
        } int temmp = b; temmp b b=a b a a = temmp a temmp int a a int b b public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;
   
        public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        }
   
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
   
        int nextInt() {
            return Integer.parseInt(next());
        }
   
        long nextLong() {
            return Long.parseLong(next());
        }
   
        double nextDouble() {
            return Double.parseDouble(next());
        }
   
        String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        }
  
     } MyScanner BufferedReader br; br StringTokenizer st; st public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        } MyScanner {
           br = new BufferedReader(new InputStreamReader(System.in));
        } br = new BufferedReader(new InputStreamReader(System.in)) br new BufferedReader(new InputStreamReader(System.in)) String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        } next {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        } while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            } st == null || !st.hasMoreElements() st == null st null !st.hasMoreElements() st.hasMoreElements() st.hasMoreElements st {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            } try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                } IOException e {
                    e.printStackTrace();
                } e.printStackTrace() e.printStackTrace e {
                    st = new StringTokenizer(br.readLine());
                } st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st int nextInt() {
            return Integer.parseInt(next());
        } nextInt {
            return Integer.parseInt(next());
        } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next long nextLong() {
            return Long.parseLong(next());
        } nextLong {
            return Long.parseLong(next());
        } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next double nextDouble() {
            return Double.parseDouble(next());
        } nextDouble {
            return Double.parseDouble(next());
        } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        } nextLine {
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        } String str = ""; str "" try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        } catch (IOException e) {
           e.printStackTrace();
        } IOException e {
           e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
           str = br.readLine();
        } str = br.readLine() str br.readLine() br.readLine br return str; str public class Main {

    static MyScanner in = new MyScanner();
    static   PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    int N;
    static int max = 200001;
    static int [] dr = {1,-1,0,0};
    static int [] dc={0,0,-1,1};
    public static void main(String args[]) throws IOException {
        int N = in.nextInt();
        int M = in.nextInt();
        int C = in.nextInt();
        int [] b = new int[M];
        int count =0; 
        for(int i=0;i<M;i++)
        b[i] = in.nextInt();
        for(int i=0;i<N;i++){
            long sum = 0;
            for(int j=0;j<M;j++){
                sum+=(in.nextInt()*b[j]);
            }
            if(sum+C>0){
                count++;
            }
        }
        out.println(count);

        out.flush();
        }
       static boolean isEven(long a){
            return (a&1)==0;
        }
       static  void swap (int a, int b){

        int temmp = b;
        b=a;
        a = temmp;
        }
    

    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;
   
        public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        }
   
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
   
        int nextInt() {
            return Integer.parseInt(next());
        }
   
        long nextLong() {
            return Long.parseLong(next());
        }
   
        double nextDouble() {
            return Double.parseDouble(next());
        }
   
        String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        }
  
     }
} public class Main {

    static MyScanner in = new MyScanner();
    static   PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    int N;
    static int max = 200001;
    static int [] dr = {1,-1,0,0};
    static int [] dc={0,0,-1,1};
    public static void main(String args[]) throws IOException {
        int N = in.nextInt();
        int M = in.nextInt();
        int C = in.nextInt();
        int [] b = new int[M];
        int count =0; 
        for(int i=0;i<M;i++)
        b[i] = in.nextInt();
        for(int i=0;i<N;i++){
            long sum = 0;
            for(int j=0;j<M;j++){
                sum+=(in.nextInt()*b[j]);
            }
            if(sum+C>0){
                count++;
            }
        }
        out.println(count);

        out.flush();
        }
       static boolean isEven(long a){
            return (a&1)==0;
        }
       static  void swap (int a, int b){

        int temmp = b;
        b=a;
        a = temmp;
        }
    

    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;
   
        public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        }
   
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
   
        int nextInt() {
            return Integer.parseInt(next());
        }
   
        long nextLong() {
            return Long.parseLong(next());
        }
   
        double nextDouble() {
            return Double.parseDouble(next());
        }
   
        String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        }
  
     }
} Main
import java.io.*;
import java.math.*;
import java.util.*;





public class Main {

    static MyScanner in = new MyScanner();
    static   PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    int N;
    static int max = 200001;
    static int [] dr = {1,-1,0,0};
    static int [] dc={0,0,-1,1};
    public static void main(String args[]) throws IOException {
        int N = in.nextInt();
        int M = in.nextInt();
        int C = in.nextInt();
        int [] b = new int[M];
        int count =0; 
        for(int i=0;i<M;i++)
        b[i] = in.nextInt();
        for(int i=0;i<N;i++){
            long sum = 0;
            for(int j=0;j<M;j++){
                sum+=(in.nextInt()*b[j]);
            }
            if(sum+C>0){
                count++;
            }
        }
        out.println(count);

        out.flush();
        }
       static boolean isEven(long a){
            return (a&1)==0;
        }
       static  void swap (int a, int b){

        int temmp = b;
        b=a;
        a = temmp;
        }
    

    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;
   
        public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        }
   
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
   
        int nextInt() {
            return Integer.parseInt(next());
        }
   
        long nextLong() {
            return Long.parseLong(next());
        }
   
        double nextDouble() {
            return Double.parseDouble(next());
        }
   
        String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        }
  
     }
}