import java.util.*;
import java.io.*;
import static java.lang.System.in;

public class Main {
    static int n,m,C;
    static int[] B;
    static HashSet<Integer>[] graph;
    public static void main(String[] args)throws IOException {
        //BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt(); m = sc.nextInt(); C = sc.nextInt();
        B = new int[m];
        for(int i=0;i<m;i++) B[i]=sc.nextInt();
        int[] a = new int[m];
        int ans = 0;
        for(int i=0;i<n;i++){
            for(int j=0;j<m;j++) a[j] = sc.nextInt();
            if(check(a)) ans++;
        }
        System.out.println(ans);
    }
    static boolean check(int[] a){
        int res = C;
        for(int j=0;j<m;j++) res += a[j]*B[j];
        return res>0;
    }
} import java.util.*; util.* java import java.io.*; io.* java import static java.lang.System.in; import static java.lang.System.in; import static java.lang.System.in; public class Main {
    static int n,m,C;
    static int[] B;
    static HashSet<Integer>[] graph;
    public static void main(String[] args)throws IOException {
        //BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt(); m = sc.nextInt(); C = sc.nextInt();
        B = new int[m];
        for(int i=0;i<m;i++) B[i]=sc.nextInt();
        int[] a = new int[m];
        int ans = 0;
        for(int i=0;i<n;i++){
            for(int j=0;j<m;j++) a[j] = sc.nextInt();
            if(check(a)) ans++;
        }
        System.out.println(ans);
    }
    static boolean check(int[] a){
        int res = C;
        for(int j=0;j<m;j++) res += a[j]*B[j];
        return res>0;
    }
} Main static int n n m m C; C static int[] B; B static HashSet<Integer>[] graph; graph public static void main(String[] args)throws IOException {
        //BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt(); m = sc.nextInt(); C = sc.nextInt();
        B = new int[m];
        for(int i=0;i<m;i++) B[i]=sc.nextInt();
        int[] a = new int[m];
        int ans = 0;
        for(int i=0;i<n;i++){
            for(int j=0;j<m;j++) a[j] = sc.nextInt();
            if(check(a)) ans++;
        }
        System.out.println(ans);
    } main {
        //BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt(); m = sc.nextInt(); C = sc.nextInt();
        B = new int[m];
        for(int i=0;i<m;i++) B[i]=sc.nextInt();
        int[] a = new int[m];
        int ans = 0;
        for(int i=0;i<n;i++){
            for(int j=0;j<m;j++) a[j] = sc.nextInt();
            if(check(a)) ans++;
        }
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) n = sc.nextInt() n sc.nextInt() sc.nextInt sc m = sc.nextInt() m sc.nextInt() sc.nextInt sc C = sc.nextInt() C sc.nextInt() sc.nextInt sc B = new int[m] B new int[m] m for(int i=0;i<m;i++) B[i]=sc.nextInt(); int i=0; int i=0; i 0 i<m i m i++ i++ i B[i]=sc.nextInt(); B[i]=sc.nextInt() B[i] B i sc.nextInt() sc.nextInt sc int[] a = new int[m]; a new int[m] m int ans = 0; ans 0 for(int i=0;i<n;i++){
            for(int j=0;j<m;j++) a[j] = sc.nextInt();
            if(check(a)) ans++;
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            for(int j=0;j<m;j++) a[j] = sc.nextInt();
            if(check(a)) ans++;
        } {
            for(int j=0;j<m;j++) a[j] = sc.nextInt();
            if(check(a)) ans++;
        } for(int j=0;j<m;j++) a[j] = sc.nextInt(); int j=0; int j=0; j 0 j<m j m j++ j++ j a[j] = sc.nextInt(); a[j] = sc.nextInt() a[j] a j sc.nextInt() sc.nextInt sc if(check(a)) ans++; check(a) check a ans++ ans System.out.println(ans) System.out.println System.out System System.out ans String[] args args static boolean check(int[] a){
        int res = C;
        for(int j=0;j<m;j++) res += a[j]*B[j];
        return res>0;
    } check {
        int res = C;
        for(int j=0;j<m;j++) res += a[j]*B[j];
        return res>0;
    } int res = C; res C for(int j=0;j<m;j++) res += a[j]*B[j]; int j=0; int j=0; j 0 j<m j m j++ j++ j res += a[j]*B[j]; res += a[j]*B[j] res a[j]*B[j] a[j] a j B[j] B j return res>0; res>0 res 0 int[] a a public class Main {
    static int n,m,C;
    static int[] B;
    static HashSet<Integer>[] graph;
    public static void main(String[] args)throws IOException {
        //BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt(); m = sc.nextInt(); C = sc.nextInt();
        B = new int[m];
        for(int i=0;i<m;i++) B[i]=sc.nextInt();
        int[] a = new int[m];
        int ans = 0;
        for(int i=0;i<n;i++){
            for(int j=0;j<m;j++) a[j] = sc.nextInt();
            if(check(a)) ans++;
        }
        System.out.println(ans);
    }
    static boolean check(int[] a){
        int res = C;
        for(int j=0;j<m;j++) res += a[j]*B[j];
        return res>0;
    }
} public class Main {
    static int n,m,C;
    static int[] B;
    static HashSet<Integer>[] graph;
    public static void main(String[] args)throws IOException {
        //BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt(); m = sc.nextInt(); C = sc.nextInt();
        B = new int[m];
        for(int i=0;i<m;i++) B[i]=sc.nextInt();
        int[] a = new int[m];
        int ans = 0;
        for(int i=0;i<n;i++){
            for(int j=0;j<m;j++) a[j] = sc.nextInt();
            if(check(a)) ans++;
        }
        System.out.println(ans);
    }
    static boolean check(int[] a){
        int res = C;
        for(int j=0;j<m;j++) res += a[j]*B[j];
        return res>0;
    }
} Main
import java.util.*;
import java.io.*;
import static java.lang.System.in;

public class Main {
    static int n,m,C;
    static int[] B;
    static HashSet<Integer>[] graph;
    public static void main(String[] args)throws IOException {
        //BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt(); m = sc.nextInt(); C = sc.nextInt();
        B = new int[m];
        for(int i=0;i<m;i++) B[i]=sc.nextInt();
        int[] a = new int[m];
        int ans = 0;
        for(int i=0;i<n;i++){
            for(int j=0;j<m;j++) a[j] = sc.nextInt();
            if(check(a)) ans++;
        }
        System.out.println(ans);
    }
    static boolean check(int[] a){
        int res = C;
        for(int j=0;j<m;j++) res += a[j]*B[j];
        return res>0;
    }
}