import java.util.Scanner;

public class Main {
    public static void main(String[] args) {


        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int[] B = new int[m];
        int[][] X = new int[n][m];
        int sum = 0;
        int ans = 0;

        for (int j = 0; j < m; j++) {
            B[j] = Integer.parseInt(sc.next());
        }

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                X[i][j] = Integer.parseInt(sc.next());
            }
        }
        for (int i = 0; i < n; i++) {
            sum = 0;
            for (int j = 0; j < m; j++) {
                sum += X[i][j] * B[j];
            }
            if (sum + c > 0) {
                ans += 1;
            }
        }
        System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {


        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int[] B = new int[m];
        int[][] X = new int[n][m];
        int sum = 0;
        int ans = 0;

        for (int j = 0; j < m; j++) {
            B[j] = Integer.parseInt(sc.next());
        }

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                X[i][j] = Integer.parseInt(sc.next());
            }
        }
        for (int i = 0; i < n; i++) {
            sum = 0;
            for (int j = 0; j < m; j++) {
                sum += X[i][j] * B[j];
            }
            if (sum + c > 0) {
                ans += 1;
            }
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) {


        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int[] B = new int[m];
        int[][] X = new int[n][m];
        int sum = 0;
        int ans = 0;

        for (int j = 0; j < m; j++) {
            B[j] = Integer.parseInt(sc.next());
        }

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                X[i][j] = Integer.parseInt(sc.next());
            }
        }
        for (int i = 0; i < n; i++) {
            sum = 0;
            for (int j = 0; j < m; j++) {
                sum += X[i][j] * B[j];
            }
            if (sum + c > 0) {
                ans += 1;
            }
        }
        System.out.println(ans);
    } main {


        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int[] B = new int[m];
        int[][] X = new int[n][m];
        int sum = 0;
        int ans = 0;

        for (int j = 0; j < m; j++) {
            B[j] = Integer.parseInt(sc.next());
        }

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                X[i][j] = Integer.parseInt(sc.next());
            }
        }
        for (int i = 0; i < n; i++) {
            sum = 0;
            for (int j = 0; j < m; j++) {
                sum += X[i][j] * B[j];
            }
            if (sum + c > 0) {
                ans += 1;
            }
        }
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int m = Integer.parseInt(sc.next()); m Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int c = Integer.parseInt(sc.next()); c Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int[] B = new int[m]; B new int[m] m int[][] X = new int[n][m]; X new int[n][m] n m int sum = 0; sum 0 int ans = 0; ans 0 for (int j = 0; j < m; j++) {
            B[j] = Integer.parseInt(sc.next());
        } int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
            B[j] = Integer.parseInt(sc.next());
        } {
            B[j] = Integer.parseInt(sc.next());
        } B[j] = Integer.parseInt(sc.next()) B[j] B j Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                X[i][j] = Integer.parseInt(sc.next());
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            for (int j = 0; j < m; j++) {
                X[i][j] = Integer.parseInt(sc.next());
            }
        } {
            for (int j = 0; j < m; j++) {
                X[i][j] = Integer.parseInt(sc.next());
            }
        } for (int j = 0; j < m; j++) {
                X[i][j] = Integer.parseInt(sc.next());
            } int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
                X[i][j] = Integer.parseInt(sc.next());
            } {
                X[i][j] = Integer.parseInt(sc.next());
            } X[i][j] = Integer.parseInt(sc.next()) X[i][j] X[i] X i j Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc for (int i = 0; i < n; i++) {
            sum = 0;
            for (int j = 0; j < m; j++) {
                sum += X[i][j] * B[j];
            }
            if (sum + c > 0) {
                ans += 1;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            sum = 0;
            for (int j = 0; j < m; j++) {
                sum += X[i][j] * B[j];
            }
            if (sum + c > 0) {
                ans += 1;
            }
        } {
            sum = 0;
            for (int j = 0; j < m; j++) {
                sum += X[i][j] * B[j];
            }
            if (sum + c > 0) {
                ans += 1;
            }
        } sum = 0 sum 0 for (int j = 0; j < m; j++) {
                sum += X[i][j] * B[j];
            } int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
                sum += X[i][j] * B[j];
            } {
                sum += X[i][j] * B[j];
            } sum += X[i][j] * B[j] sum X[i][j] * B[j] X[i][j] X[i] X i j B[j] B j if (sum + c > 0) {
                ans += 1;
            } sum + c > 0 sum + c sum c 0 {
                ans += 1;
            } ans += 1 ans 1 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args) {


        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int[] B = new int[m];
        int[][] X = new int[n][m];
        int sum = 0;
        int ans = 0;

        for (int j = 0; j < m; j++) {
            B[j] = Integer.parseInt(sc.next());
        }

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                X[i][j] = Integer.parseInt(sc.next());
            }
        }
        for (int i = 0; i < n; i++) {
            sum = 0;
            for (int j = 0; j < m; j++) {
                sum += X[i][j] * B[j];
            }
            if (sum + c > 0) {
                ans += 1;
            }
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {


        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int[] B = new int[m];
        int[][] X = new int[n][m];
        int sum = 0;
        int ans = 0;

        for (int j = 0; j < m; j++) {
            B[j] = Integer.parseInt(sc.next());
        }

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                X[i][j] = Integer.parseInt(sc.next());
            }
        }
        for (int i = 0; i < n; i++) {
            sum = 0;
            for (int j = 0; j < m; j++) {
                sum += X[i][j] * B[j];
            }
            if (sum + c > 0) {
                ans += 1;
            }
        }
        System.out.println(ans);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {


        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int[] B = new int[m];
        int[][] X = new int[n][m];
        int sum = 0;
        int ans = 0;

        for (int j = 0; j < m; j++) {
            B[j] = Integer.parseInt(sc.next());
        }

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                X[i][j] = Integer.parseInt(sc.next());
            }
        }
        for (int i = 0; i < n; i++) {
            sum = 0;
            for (int j = 0; j < m; j++) {
                sum += X[i][j] * B[j];
            }
            if (sum + c > 0) {
                ans += 1;
            }
        }
        System.out.println(ans);
    }
}