
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int N = Integer.parseInt(st.nextToken());
        int M = Integer.parseInt(st.nextToken());
        int C = Integer.parseInt(st.nextToken());
        int counter = 0;
        int[] B = new int[M];
        st = new StringTokenizer(br.readLine());
        for (int i=0; i<M; i++) {
            B[i] = Integer.parseInt(st.nextToken());
        }
        for (int i=0; i<N; i++) {
            st = new StringTokenizer(br.readLine());
            int[] temp = new int[M];
            for (int j=0; j<M; j++) {
                temp[j] = Integer.parseInt(st.nextToken());
            }
            int total = 0;
            for (int j=0; j<M; j++) {
                total += temp[j]*B[j];
            }
            total += C;
            if (total > 0) counter ++;
        }
        System.out.println(counter);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.StreamTokenizer; StreamTokenizer java.io import java.util.StringTokenizer; StringTokenizer java.util public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int N = Integer.parseInt(st.nextToken());
        int M = Integer.parseInt(st.nextToken());
        int C = Integer.parseInt(st.nextToken());
        int counter = 0;
        int[] B = new int[M];
        st = new StringTokenizer(br.readLine());
        for (int i=0; i<M; i++) {
            B[i] = Integer.parseInt(st.nextToken());
        }
        for (int i=0; i<N; i++) {
            st = new StringTokenizer(br.readLine());
            int[] temp = new int[M];
            for (int j=0; j<M; j++) {
                temp[j] = Integer.parseInt(st.nextToken());
            }
            int total = 0;
            for (int j=0; j<M; j++) {
                total += temp[j]*B[j];
            }
            total += C;
            if (total > 0) counter ++;
        }
        System.out.println(counter);
    }
} Main public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int N = Integer.parseInt(st.nextToken());
        int M = Integer.parseInt(st.nextToken());
        int C = Integer.parseInt(st.nextToken());
        int counter = 0;
        int[] B = new int[M];
        st = new StringTokenizer(br.readLine());
        for (int i=0; i<M; i++) {
            B[i] = Integer.parseInt(st.nextToken());
        }
        for (int i=0; i<N; i++) {
            st = new StringTokenizer(br.readLine());
            int[] temp = new int[M];
            for (int j=0; j<M; j++) {
                temp[j] = Integer.parseInt(st.nextToken());
            }
            int total = 0;
            for (int j=0; j<M; j++) {
                total += temp[j]*B[j];
            }
            total += C;
            if (total > 0) counter ++;
        }
        System.out.println(counter);
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int N = Integer.parseInt(st.nextToken());
        int M = Integer.parseInt(st.nextToken());
        int C = Integer.parseInt(st.nextToken());
        int counter = 0;
        int[] B = new int[M];
        st = new StringTokenizer(br.readLine());
        for (int i=0; i<M; i++) {
            B[i] = Integer.parseInt(st.nextToken());
        }
        for (int i=0; i<N; i++) {
            st = new StringTokenizer(br.readLine());
            int[] temp = new int[M];
            for (int j=0; j<M; j++) {
                temp[j] = Integer.parseInt(st.nextToken());
            }
            int total = 0;
            for (int j=0; j<M; j++) {
                total += temp[j]*B[j];
            }
            total += C;
            if (total > 0) counter ++;
        }
        System.out.println(counter);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringTokenizer st = new StringTokenizer(br.readLine()); st new StringTokenizer(br.readLine()) int N = Integer.parseInt(st.nextToken()); N Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st int M = Integer.parseInt(st.nextToken()); M Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st int C = Integer.parseInt(st.nextToken()); C Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st int counter = 0; counter 0 int[] B = new int[M]; B new int[M] M st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) for (int i=0; i<M; i++) {
            B[i] = Integer.parseInt(st.nextToken());
        } int i=0; int i=0; i 0 i<M i M i++ i++ i {
            B[i] = Integer.parseInt(st.nextToken());
        } {
            B[i] = Integer.parseInt(st.nextToken());
        } B[i] = Integer.parseInt(st.nextToken()) B[i] B i Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st for (int i=0; i<N; i++) {
            st = new StringTokenizer(br.readLine());
            int[] temp = new int[M];
            for (int j=0; j<M; j++) {
                temp[j] = Integer.parseInt(st.nextToken());
            }
            int total = 0;
            for (int j=0; j<M; j++) {
                total += temp[j]*B[j];
            }
            total += C;
            if (total > 0) counter ++;
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            st = new StringTokenizer(br.readLine());
            int[] temp = new int[M];
            for (int j=0; j<M; j++) {
                temp[j] = Integer.parseInt(st.nextToken());
            }
            int total = 0;
            for (int j=0; j<M; j++) {
                total += temp[j]*B[j];
            }
            total += C;
            if (total > 0) counter ++;
        } {
            st = new StringTokenizer(br.readLine());
            int[] temp = new int[M];
            for (int j=0; j<M; j++) {
                temp[j] = Integer.parseInt(st.nextToken());
            }
            int total = 0;
            for (int j=0; j<M; j++) {
                total += temp[j]*B[j];
            }
            total += C;
            if (total > 0) counter ++;
        } st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) int[] temp = new int[M]; temp new int[M] M for (int j=0; j<M; j++) {
                temp[j] = Integer.parseInt(st.nextToken());
            } int j=0; int j=0; j 0 j<M j M j++ j++ j {
                temp[j] = Integer.parseInt(st.nextToken());
            } {
                temp[j] = Integer.parseInt(st.nextToken());
            } temp[j] = Integer.parseInt(st.nextToken()) temp[j] temp j Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st int total = 0; total 0 for (int j=0; j<M; j++) {
                total += temp[j]*B[j];
            } int j=0; int j=0; j 0 j<M j M j++ j++ j {
                total += temp[j]*B[j];
            } {
                total += temp[j]*B[j];
            } total += temp[j]*B[j] total temp[j]*B[j] temp[j] temp j B[j] B j total += C total C if (total > 0) counter ++; total > 0 total 0 counter ++ counter System.out.println(counter) System.out.println System.out System System.out counter String[] args args public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int N = Integer.parseInt(st.nextToken());
        int M = Integer.parseInt(st.nextToken());
        int C = Integer.parseInt(st.nextToken());
        int counter = 0;
        int[] B = new int[M];
        st = new StringTokenizer(br.readLine());
        for (int i=0; i<M; i++) {
            B[i] = Integer.parseInt(st.nextToken());
        }
        for (int i=0; i<N; i++) {
            st = new StringTokenizer(br.readLine());
            int[] temp = new int[M];
            for (int j=0; j<M; j++) {
                temp[j] = Integer.parseInt(st.nextToken());
            }
            int total = 0;
            for (int j=0; j<M; j++) {
                total += temp[j]*B[j];
            }
            total += C;
            if (total > 0) counter ++;
        }
        System.out.println(counter);
    }
} public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int N = Integer.parseInt(st.nextToken());
        int M = Integer.parseInt(st.nextToken());
        int C = Integer.parseInt(st.nextToken());
        int counter = 0;
        int[] B = new int[M];
        st = new StringTokenizer(br.readLine());
        for (int i=0; i<M; i++) {
            B[i] = Integer.parseInt(st.nextToken());
        }
        for (int i=0; i<N; i++) {
            st = new StringTokenizer(br.readLine());
            int[] temp = new int[M];
            for (int j=0; j<M; j++) {
                temp[j] = Integer.parseInt(st.nextToken());
            }
            int total = 0;
            for (int j=0; j<M; j++) {
                total += temp[j]*B[j];
            }
            total += C;
            if (total > 0) counter ++;
        }
        System.out.println(counter);
    }
} Main

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int N = Integer.parseInt(st.nextToken());
        int M = Integer.parseInt(st.nextToken());
        int C = Integer.parseInt(st.nextToken());
        int counter = 0;
        int[] B = new int[M];
        st = new StringTokenizer(br.readLine());
        for (int i=0; i<M; i++) {
            B[i] = Integer.parseInt(st.nextToken());
        }
        for (int i=0; i<N; i++) {
            st = new StringTokenizer(br.readLine());
            int[] temp = new int[M];
            for (int j=0; j<M; j++) {
                temp[j] = Integer.parseInt(st.nextToken());
            }
            int total = 0;
            for (int j=0; j<M; j++) {
                total += temp[j]*B[j];
            }
            total += C;
            if (total > 0) counter ++;
        }
        System.out.println(counter);
    }
}
