import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();// ソースコードの数
        int m = sc.nextInt();// 整数の数
        int c = sc.nextInt();// 定数C

        int[] bArr = new int[m];
        int[][] aArr = new int[n][m];

        for (int i = 0; i < m; i++) {
            bArr[i] = sc.nextInt();
        }

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                aArr[i][j] = sc.nextInt();
            }
        }

        int res = 0;
        for (int i = 0; i < n; i++) {
            int sum = 0;
            for (int j = 0; j < m; j++) {
                sum += aArr[i][j] * bArr[j];
            }
            sum += c;
            if (sum > 0) res++;
        }

        System.out.println(res);
    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();// ソースコードの数
        int m = sc.nextInt();// 整数の数
        int c = sc.nextInt();// 定数C

        int[] bArr = new int[m];
        int[][] aArr = new int[n][m];

        for (int i = 0; i < m; i++) {
            bArr[i] = sc.nextInt();
        }

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                aArr[i][j] = sc.nextInt();
            }
        }

        int res = 0;
        for (int i = 0; i < n; i++) {
            int sum = 0;
            for (int j = 0; j < m; j++) {
                sum += aArr[i][j] * bArr[j];
            }
            sum += c;
            if (sum > 0) res++;
        }

        System.out.println(res);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();// ソースコードの数
        int m = sc.nextInt();// 整数の数
        int c = sc.nextInt();// 定数C

        int[] bArr = new int[m];
        int[][] aArr = new int[n][m];

        for (int i = 0; i < m; i++) {
            bArr[i] = sc.nextInt();
        }

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                aArr[i][j] = sc.nextInt();
            }
        }

        int res = 0;
        for (int i = 0; i < n; i++) {
            int sum = 0;
            for (int j = 0; j < m; j++) {
                sum += aArr[i][j] * bArr[j];
            }
            sum += c;
            if (sum > 0) res++;
        }

        System.out.println(res);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();// ソースコードの数
        int m = sc.nextInt();// 整数の数
        int c = sc.nextInt();// 定数C

        int[] bArr = new int[m];
        int[][] aArr = new int[n][m];

        for (int i = 0; i < m; i++) {
            bArr[i] = sc.nextInt();
        }

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                aArr[i][j] = sc.nextInt();
            }
        }

        int res = 0;
        for (int i = 0; i < n; i++) {
            int sum = 0;
            for (int j = 0; j < m; j++) {
                sum += aArr[i][j] * bArr[j];
            }
            sum += c;
            if (sum > 0) res++;
        }

        System.out.println(res);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc int c = sc.nextInt(); c sc.nextInt() sc.nextInt sc int[] bArr = new int[m]; bArr new int[m] m int[][] aArr = new int[n][m]; aArr new int[n][m] n m for (int i = 0; i < m; i++) {
            bArr[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            bArr[i] = sc.nextInt();
        } {
            bArr[i] = sc.nextInt();
        } bArr[i] = sc.nextInt() bArr[i] bArr i sc.nextInt() sc.nextInt sc for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                aArr[i][j] = sc.nextInt();
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            for (int j = 0; j < m; j++) {
                aArr[i][j] = sc.nextInt();
            }
        } {
            for (int j = 0; j < m; j++) {
                aArr[i][j] = sc.nextInt();
            }
        } for (int j = 0; j < m; j++) {
                aArr[i][j] = sc.nextInt();
            } int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
                aArr[i][j] = sc.nextInt();
            } {
                aArr[i][j] = sc.nextInt();
            } aArr[i][j] = sc.nextInt() aArr[i][j] aArr[i] aArr i j sc.nextInt() sc.nextInt sc int res = 0; res 0 for (int i = 0; i < n; i++) {
            int sum = 0;
            for (int j = 0; j < m; j++) {
                sum += aArr[i][j] * bArr[j];
            }
            sum += c;
            if (sum > 0) res++;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            int sum = 0;
            for (int j = 0; j < m; j++) {
                sum += aArr[i][j] * bArr[j];
            }
            sum += c;
            if (sum > 0) res++;
        } {
            int sum = 0;
            for (int j = 0; j < m; j++) {
                sum += aArr[i][j] * bArr[j];
            }
            sum += c;
            if (sum > 0) res++;
        } int sum = 0; sum 0 for (int j = 0; j < m; j++) {
                sum += aArr[i][j] * bArr[j];
            } int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
                sum += aArr[i][j] * bArr[j];
            } {
                sum += aArr[i][j] * bArr[j];
            } sum += aArr[i][j] * bArr[j] sum aArr[i][j] * bArr[j] aArr[i][j] aArr[i] aArr i j bArr[j] bArr j sum += c sum c if (sum > 0) res++; sum > 0 sum 0 res++ res System.out.println(res) System.out.println System.out System System.out res String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();// ソースコードの数
        int m = sc.nextInt();// 整数の数
        int c = sc.nextInt();// 定数C

        int[] bArr = new int[m];
        int[][] aArr = new int[n][m];

        for (int i = 0; i < m; i++) {
            bArr[i] = sc.nextInt();
        }

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                aArr[i][j] = sc.nextInt();
            }
        }

        int res = 0;
        for (int i = 0; i < n; i++) {
            int sum = 0;
            for (int j = 0; j < m; j++) {
                sum += aArr[i][j] * bArr[j];
            }
            sum += c;
            if (sum > 0) res++;
        }

        System.out.println(res);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();// ソースコードの数
        int m = sc.nextInt();// 整数の数
        int c = sc.nextInt();// 定数C

        int[] bArr = new int[m];
        int[][] aArr = new int[n][m];

        for (int i = 0; i < m; i++) {
            bArr[i] = sc.nextInt();
        }

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                aArr[i][j] = sc.nextInt();
            }
        }

        int res = 0;
        for (int i = 0; i < n; i++) {
            int sum = 0;
            for (int j = 0; j < m; j++) {
                sum += aArr[i][j] * bArr[j];
            }
            sum += c;
            if (sum > 0) res++;
        }

        System.out.println(res);
    }
} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();// ソースコードの数
        int m = sc.nextInt();// 整数の数
        int c = sc.nextInt();// 定数C

        int[] bArr = new int[m];
        int[][] aArr = new int[n][m];

        for (int i = 0; i < m; i++) {
            bArr[i] = sc.nextInt();
        }

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                aArr[i][j] = sc.nextInt();
            }
        }

        int res = 0;
        for (int i = 0; i < n; i++) {
            int sum = 0;
            for (int j = 0; j < m; j++) {
                sum += aArr[i][j] * bArr[j];
            }
            sum += c;
            if (sum > 0) res++;
        }

        System.out.println(res);
    }
}
