import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int m = s.nextInt();
        int c = s.nextInt();
        int a[][] = new int[n + 1][m];
        for (int i = 0; i < n + 1; i++) {
            for (int j = 0; j < m; j++) {
                a[i][j] = s.nextInt();
            }
        }
        int ans = 0;
        int cnt = 0;
        for (int i = 0; i < (n+1); i++) {
            if (i == 0)
                continue;
            for (int j = 0; j < m; j++) {
                cnt += (a[0][j] * a[i][j]);
            }
            cnt += c;
            if (cnt > 0)
                ans++;
            cnt = 0;
        }
        System.out.print(ans);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int m = s.nextInt();
        int c = s.nextInt();
        int a[][] = new int[n + 1][m];
        for (int i = 0; i < n + 1; i++) {
            for (int j = 0; j < m; j++) {
                a[i][j] = s.nextInt();
            }
        }
        int ans = 0;
        int cnt = 0;
        for (int i = 0; i < (n+1); i++) {
            if (i == 0)
                continue;
            for (int j = 0; j < m; j++) {
                cnt += (a[0][j] * a[i][j]);
            }
            cnt += c;
            if (cnt > 0)
                ans++;
            cnt = 0;
        }
        System.out.print(ans);
    }
} Main public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int m = s.nextInt();
        int c = s.nextInt();
        int a[][] = new int[n + 1][m];
        for (int i = 0; i < n + 1; i++) {
            for (int j = 0; j < m; j++) {
                a[i][j] = s.nextInt();
            }
        }
        int ans = 0;
        int cnt = 0;
        for (int i = 0; i < (n+1); i++) {
            if (i == 0)
                continue;
            for (int j = 0; j < m; j++) {
                cnt += (a[0][j] * a[i][j]);
            }
            cnt += c;
            if (cnt > 0)
                ans++;
            cnt = 0;
        }
        System.out.print(ans);
    } main {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int m = s.nextInt();
        int c = s.nextInt();
        int a[][] = new int[n + 1][m];
        for (int i = 0; i < n + 1; i++) {
            for (int j = 0; j < m; j++) {
                a[i][j] = s.nextInt();
            }
        }
        int ans = 0;
        int cnt = 0;
        for (int i = 0; i < (n+1); i++) {
            if (i == 0)
                continue;
            for (int j = 0; j < m; j++) {
                cnt += (a[0][j] * a[i][j]);
            }
            cnt += c;
            if (cnt > 0)
                ans++;
            cnt = 0;
        }
        System.out.print(ans);
    } Scanner s = new Scanner(System.in); s new Scanner(System.in) int n = s.nextInt(); n s.nextInt() s.nextInt s int m = s.nextInt(); m s.nextInt() s.nextInt s int c = s.nextInt(); c s.nextInt() s.nextInt s int a[][] = new int[n + 1][m]; a new int[n + 1][m] n + 1 n 1 m for (int i = 0; i < n + 1; i++) {
            for (int j = 0; j < m; j++) {
                a[i][j] = s.nextInt();
            }
        } int i = 0; int i = 0; i 0 i < n + 1 i n + 1 n 1 i++ i++ i {
            for (int j = 0; j < m; j++) {
                a[i][j] = s.nextInt();
            }
        } {
            for (int j = 0; j < m; j++) {
                a[i][j] = s.nextInt();
            }
        } for (int j = 0; j < m; j++) {
                a[i][j] = s.nextInt();
            } int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
                a[i][j] = s.nextInt();
            } {
                a[i][j] = s.nextInt();
            } a[i][j] = s.nextInt() a[i][j] a[i] a i j s.nextInt() s.nextInt s int ans = 0; ans 0 int cnt = 0; cnt 0 for (int i = 0; i < (n+1); i++) {
            if (i == 0)
                continue;
            for (int j = 0; j < m; j++) {
                cnt += (a[0][j] * a[i][j]);
            }
            cnt += c;
            if (cnt > 0)
                ans++;
            cnt = 0;
        } int i = 0; int i = 0; i 0 i < (n+1) i (n+1) n 1 i++ i++ i {
            if (i == 0)
                continue;
            for (int j = 0; j < m; j++) {
                cnt += (a[0][j] * a[i][j]);
            }
            cnt += c;
            if (cnt > 0)
                ans++;
            cnt = 0;
        } {
            if (i == 0)
                continue;
            for (int j = 0; j < m; j++) {
                cnt += (a[0][j] * a[i][j]);
            }
            cnt += c;
            if (cnt > 0)
                ans++;
            cnt = 0;
        } if (i == 0)
                continue; i == 0 i 0 continue; for (int j = 0; j < m; j++) {
                cnt += (a[0][j] * a[i][j]);
            } int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
                cnt += (a[0][j] * a[i][j]);
            } {
                cnt += (a[0][j] * a[i][j]);
            } cnt += (a[0][j] * a[i][j]) cnt (a[0][j] * a[i][j]) a[0][j] a[0] a 0 j a[i][j] a[i] a i j cnt += c cnt c if (cnt > 0)
                ans++; cnt > 0 cnt 0 ans++ ans cnt = 0 cnt 0 System.out.print(ans) System.out.print System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int m = s.nextInt();
        int c = s.nextInt();
        int a[][] = new int[n + 1][m];
        for (int i = 0; i < n + 1; i++) {
            for (int j = 0; j < m; j++) {
                a[i][j] = s.nextInt();
            }
        }
        int ans = 0;
        int cnt = 0;
        for (int i = 0; i < (n+1); i++) {
            if (i == 0)
                continue;
            for (int j = 0; j < m; j++) {
                cnt += (a[0][j] * a[i][j]);
            }
            cnt += c;
            if (cnt > 0)
                ans++;
            cnt = 0;
        }
        System.out.print(ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int m = s.nextInt();
        int c = s.nextInt();
        int a[][] = new int[n + 1][m];
        for (int i = 0; i < n + 1; i++) {
            for (int j = 0; j < m; j++) {
                a[i][j] = s.nextInt();
            }
        }
        int ans = 0;
        int cnt = 0;
        for (int i = 0; i < (n+1); i++) {
            if (i == 0)
                continue;
            for (int j = 0; j < m; j++) {
                cnt += (a[0][j] * a[i][j]);
            }
            cnt += c;
            if (cnt > 0)
                ans++;
            cnt = 0;
        }
        System.out.print(ans);
    }
} Main
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int m = s.nextInt();
        int c = s.nextInt();
        int a[][] = new int[n + 1][m];
        for (int i = 0; i < n + 1; i++) {
            for (int j = 0; j < m; j++) {
                a[i][j] = s.nextInt();
            }
        }
        int ans = 0;
        int cnt = 0;
        for (int i = 0; i < (n+1); i++) {
            if (i == 0)
                continue;
            for (int j = 0; j < m; j++) {
                cnt += (a[0][j] * a[i][j]);
            }
            cnt += c;
            if (cnt > 0)
                ans++;
            cnt = 0;
        }
        System.out.print(ans);
    }
}