import java.math.*;
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();
        int b[] = new int[m];
        int cnt = 0;
        for (int i = 0; i < m; i++)
            b[i] = sc.nextInt();
        for (int i = 0; i < n; i++) {
            int tmp = 0;
            for (int k = 0; k < m; k++) {
                int tm = sc.nextInt();
                tmp += (tm * b[k]);
            }
            if (tmp + c > 0)
                cnt++;
        }
        System.out.println(cnt);
    }
} import java.math.*; math.* java 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();
        int b[] = new int[m];
        int cnt = 0;
        for (int i = 0; i < m; i++)
            b[i] = sc.nextInt();
        for (int i = 0; i < n; i++) {
            int tmp = 0;
            for (int k = 0; k < m; k++) {
                int tm = sc.nextInt();
                tmp += (tm * b[k]);
            }
            if (tmp + c > 0)
                cnt++;
        }
        System.out.println(cnt);
    }
} 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];
        int cnt = 0;
        for (int i = 0; i < m; i++)
            b[i] = sc.nextInt();
        for (int i = 0; i < n; i++) {
            int tmp = 0;
            for (int k = 0; k < m; k++) {
                int tm = sc.nextInt();
                tmp += (tm * b[k]);
            }
            if (tmp + c > 0)
                cnt++;
        }
        System.out.println(cnt);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int c = sc.nextInt();
        int b[] = new int[m];
        int cnt = 0;
        for (int i = 0; i < m; i++)
            b[i] = sc.nextInt();
        for (int i = 0; i < n; i++) {
            int tmp = 0;
            for (int k = 0; k < m; k++) {
                int tm = sc.nextInt();
                tmp += (tm * b[k]);
            }
            if (tmp + c > 0)
                cnt++;
        }
        System.out.println(cnt);
    } 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 int cnt = 0; cnt 0 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 for (int i = 0; i < n; i++) {
            int tmp = 0;
            for (int k = 0; k < m; k++) {
                int tm = sc.nextInt();
                tmp += (tm * b[k]);
            }
            if (tmp + c > 0)
                cnt++;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            int tmp = 0;
            for (int k = 0; k < m; k++) {
                int tm = sc.nextInt();
                tmp += (tm * b[k]);
            }
            if (tmp + c > 0)
                cnt++;
        } {
            int tmp = 0;
            for (int k = 0; k < m; k++) {
                int tm = sc.nextInt();
                tmp += (tm * b[k]);
            }
            if (tmp + c > 0)
                cnt++;
        } int tmp = 0; tmp 0 for (int k = 0; k < m; k++) {
                int tm = sc.nextInt();
                tmp += (tm * b[k]);
            } int k = 0; int k = 0; k 0 k < m k m k++ k++ k {
                int tm = sc.nextInt();
                tmp += (tm * b[k]);
            } {
                int tm = sc.nextInt();
                tmp += (tm * b[k]);
            } int tm = sc.nextInt(); tm sc.nextInt() sc.nextInt sc tmp += (tm * b[k]) tmp (tm * b[k]) tm b[k] b k if (tmp + c > 0)
                cnt++; tmp + c > 0 tmp + c tmp c 0 cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt 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];
        int cnt = 0;
        for (int i = 0; i < m; i++)
            b[i] = sc.nextInt();
        for (int i = 0; i < n; i++) {
            int tmp = 0;
            for (int k = 0; k < m; k++) {
                int tm = sc.nextInt();
                tmp += (tm * b[k]);
            }
            if (tmp + c > 0)
                cnt++;
        }
        System.out.println(cnt);
    }
} 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];
        int cnt = 0;
        for (int i = 0; i < m; i++)
            b[i] = sc.nextInt();
        for (int i = 0; i < n; i++) {
            int tmp = 0;
            for (int k = 0; k < m; k++) {
                int tm = sc.nextInt();
                tmp += (tm * b[k]);
            }
            if (tmp + c > 0)
                cnt++;
        }
        System.out.println(cnt);
    }
} Main
import java.math.*;
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();
        int b[] = new int[m];
        int cnt = 0;
        for (int i = 0; i < m; i++)
            b[i] = sc.nextInt();
        for (int i = 0; i < n; i++) {
            int tmp = 0;
            for (int k = 0; k < m; k++) {
                int tm = sc.nextInt();
                tmp += (tm * b[k]);
            }
            if (tmp + c > 0)
                cnt++;
        }
        System.out.println(cnt);
    }
}
