
import java.util.*;

import static java.lang.System.*;

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();

        int[] b = new int[M];
        for (int j = 0; j < M; j++) {
            b[j] = sc.nextInt();
        }

        int[][] a = new int[N][M];
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < M; j++) {
                a[i][j] = sc.nextInt();
            }
        }

        int ans = 0;
        for (int i = 0; i < N; i++) {
            int tmp = 0;
            for (int j = 0; j < M; j++) {
                tmp += a[i][j]*b[j];
            }
            tmp += C;
            if(tmp > 0){
                ans++;
            }
        }

        out.println(ans);
    }
} import java.util.*; util.* java import static java.lang.System.*; import static java.lang.System.*; import static java.lang.System.*; 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();

        int[] b = new int[M];
        for (int j = 0; j < M; j++) {
            b[j] = sc.nextInt();
        }

        int[][] a = new int[N][M];
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < M; j++) {
                a[i][j] = sc.nextInt();
            }
        }

        int ans = 0;
        for (int i = 0; i < N; i++) {
            int tmp = 0;
            for (int j = 0; j < M; j++) {
                tmp += a[i][j]*b[j];
            }
            tmp += C;
            if(tmp > 0){
                ans++;
            }
        }

        out.println(ans);
    }
} 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();

        int[] b = new int[M];
        for (int j = 0; j < M; j++) {
            b[j] = sc.nextInt();
        }

        int[][] a = new int[N][M];
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < M; j++) {
                a[i][j] = sc.nextInt();
            }
        }

        int ans = 0;
        for (int i = 0; i < N; i++) {
            int tmp = 0;
            for (int j = 0; j < M; j++) {
                tmp += a[i][j]*b[j];
            }
            tmp += C;
            if(tmp > 0){
                ans++;
            }
        }

        out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int C = sc.nextInt();

        int[] b = new int[M];
        for (int j = 0; j < M; j++) {
            b[j] = sc.nextInt();
        }

        int[][] a = new int[N][M];
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < M; j++) {
                a[i][j] = sc.nextInt();
            }
        }

        int ans = 0;
        for (int i = 0; i < N; i++) {
            int tmp = 0;
            for (int j = 0; j < M; j++) {
                tmp += a[i][j]*b[j];
            }
            tmp += C;
            if(tmp > 0){
                ans++;
            }
        }

        out.println(ans);
    } 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[] b = new int[M]; b new int[M] M for (int j = 0; j < M; j++) {
            b[j] = sc.nextInt();
        } int j = 0; int j = 0; j 0 j < M j M j++ j++ j {
            b[j] = sc.nextInt();
        } {
            b[j] = sc.nextInt();
        } b[j] = sc.nextInt() b[j] b j sc.nextInt() sc.nextInt sc int[][] a = new int[N][M]; a new int[N][M] N M for (int i = 0; i < N; i++) {
            for (int j = 0; j < M; j++) {
                a[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++) {
                a[i][j] = sc.nextInt();
            }
        } {
            for (int j = 0; j < M; j++) {
                a[i][j] = sc.nextInt();
            }
        } for (int j = 0; j < M; j++) {
                a[i][j] = sc.nextInt();
            } int j = 0; int j = 0; j 0 j < M j M j++ j++ j {
                a[i][j] = sc.nextInt();
            } {
                a[i][j] = sc.nextInt();
            } a[i][j] = sc.nextInt() a[i][j] a[i] a i j sc.nextInt() sc.nextInt sc int ans = 0; ans 0 for (int i = 0; i < N; i++) {
            int tmp = 0;
            for (int j = 0; j < M; j++) {
                tmp += a[i][j]*b[j];
            }
            tmp += C;
            if(tmp > 0){
                ans++;
            }
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            int tmp = 0;
            for (int j = 0; j < M; j++) {
                tmp += a[i][j]*b[j];
            }
            tmp += C;
            if(tmp > 0){
                ans++;
            }
        } {
            int tmp = 0;
            for (int j = 0; j < M; j++) {
                tmp += a[i][j]*b[j];
            }
            tmp += C;
            if(tmp > 0){
                ans++;
            }
        } int tmp = 0; tmp 0 for (int j = 0; j < M; j++) {
                tmp += a[i][j]*b[j];
            } int j = 0; int j = 0; j 0 j < M j M j++ j++ j {
                tmp += a[i][j]*b[j];
            } {
                tmp += a[i][j]*b[j];
            } tmp += a[i][j]*b[j] tmp a[i][j]*b[j] a[i][j] a[i] a i j b[j] b j tmp += C tmp C if(tmp > 0){
                ans++;
            } tmp > 0 tmp 0 {
                ans++;
            } ans++ ans out.println(ans) out.println out ans 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();

        int[] b = new int[M];
        for (int j = 0; j < M; j++) {
            b[j] = sc.nextInt();
        }

        int[][] a = new int[N][M];
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < M; j++) {
                a[i][j] = sc.nextInt();
            }
        }

        int ans = 0;
        for (int i = 0; i < N; i++) {
            int tmp = 0;
            for (int j = 0; j < M; j++) {
                tmp += a[i][j]*b[j];
            }
            tmp += C;
            if(tmp > 0){
                ans++;
            }
        }

        out.println(ans);
    }
} 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();

        int[] b = new int[M];
        for (int j = 0; j < M; j++) {
            b[j] = sc.nextInt();
        }

        int[][] a = new int[N][M];
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < M; j++) {
                a[i][j] = sc.nextInt();
            }
        }

        int ans = 0;
        for (int i = 0; i < N; i++) {
            int tmp = 0;
            for (int j = 0; j < M; j++) {
                tmp += a[i][j]*b[j];
            }
            tmp += C;
            if(tmp > 0){
                ans++;
            }
        }

        out.println(ans);
    }
} Main

import java.util.*;

import static java.lang.System.*;

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();

        int[] b = new int[M];
        for (int j = 0; j < M; j++) {
            b[j] = sc.nextInt();
        }

        int[][] a = new int[N][M];
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < M; j++) {
                a[i][j] = sc.nextInt();
            }
        }

        int ans = 0;
        for (int i = 0; i < N; i++) {
            int tmp = 0;
            for (int j = 0; j < M; j++) {
                tmp += a[i][j]*b[j];
            }
            tmp += C;
            if(tmp > 0){
                ans++;
            }
        }

        out.println(ans);
    }
}
