
import java.util.Scanner;

public class Main {
    public static void main(String [] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int c = scanner.nextInt();
        int [] b = new int[m];
        for (int i = 0; i < m; ++i) {
            b[i] = scanner.nextInt();
        }
        int  [][] a = new int[n][m];
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < m; ++j) {
                a[i][j] = scanner.nextInt();
            }
        }
        int count = 0;
        for (int i = 0; i < n; ++i) {
            long res = c;
            for (int j = 0; j < m; ++j) {
                res += a[i][j] * b[j];
            }
            if (res > 0) {
                ++count;
            }
        }
        System.out.println(count);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String [] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int c = scanner.nextInt();
        int [] b = new int[m];
        for (int i = 0; i < m; ++i) {
            b[i] = scanner.nextInt();
        }
        int  [][] a = new int[n][m];
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < m; ++j) {
                a[i][j] = scanner.nextInt();
            }
        }
        int count = 0;
        for (int i = 0; i < n; ++i) {
            long res = c;
            for (int j = 0; j < m; ++j) {
                res += a[i][j] * b[j];
            }
            if (res > 0) {
                ++count;
            }
        }
        System.out.println(count);
    }
} Main public static void main(String [] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int c = scanner.nextInt();
        int [] b = new int[m];
        for (int i = 0; i < m; ++i) {
            b[i] = scanner.nextInt();
        }
        int  [][] a = new int[n][m];
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < m; ++j) {
                a[i][j] = scanner.nextInt();
            }
        }
        int count = 0;
        for (int i = 0; i < n; ++i) {
            long res = c;
            for (int j = 0; j < m; ++j) {
                res += a[i][j] * b[j];
            }
            if (res > 0) {
                ++count;
            }
        }
        System.out.println(count);
    } main {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int c = scanner.nextInt();
        int [] b = new int[m];
        for (int i = 0; i < m; ++i) {
            b[i] = scanner.nextInt();
        }
        int  [][] a = new int[n][m];
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < m; ++j) {
                a[i][j] = scanner.nextInt();
            }
        }
        int count = 0;
        for (int i = 0; i < n; ++i) {
            long res = c;
            for (int j = 0; j < m; ++j) {
                res += a[i][j] * b[j];
            }
            if (res > 0) {
                ++count;
            }
        }
        System.out.println(count);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int m = scanner.nextInt(); m scanner.nextInt() scanner.nextInt scanner int c = scanner.nextInt(); c scanner.nextInt() scanner.nextInt scanner int [] b = new int[m]; b new int[m] m for (int i = 0; i < m; ++i) {
            b[i] = scanner.nextInt();
        } int i = 0; int i = 0; i 0 i < m i m ++i ++i i {
            b[i] = scanner.nextInt();
        } {
            b[i] = scanner.nextInt();
        } b[i] = scanner.nextInt() b[i] b i scanner.nextInt() scanner.nextInt scanner 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] = scanner.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] = scanner.nextInt();
            }
        } {
            for (int j = 0; j < m; ++j) {
                a[i][j] = scanner.nextInt();
            }
        } for (int j = 0; j < m; ++j) {
                a[i][j] = scanner.nextInt();
            } int j = 0; int j = 0; j 0 j < m j m ++j ++j j {
                a[i][j] = scanner.nextInt();
            } {
                a[i][j] = scanner.nextInt();
            } a[i][j] = scanner.nextInt() a[i][j] a[i] a i j scanner.nextInt() scanner.nextInt scanner int count = 0; count 0 for (int i = 0; i < n; ++i) {
            long res = c;
            for (int j = 0; j < m; ++j) {
                res += a[i][j] * b[j];
            }
            if (res > 0) {
                ++count;
            }
        } int i = 0; int i = 0; i 0 i < n i n ++i ++i i {
            long res = c;
            for (int j = 0; j < m; ++j) {
                res += a[i][j] * b[j];
            }
            if (res > 0) {
                ++count;
            }
        } {
            long res = c;
            for (int j = 0; j < m; ++j) {
                res += a[i][j] * b[j];
            }
            if (res > 0) {
                ++count;
            }
        } long res = c; res c for (int j = 0; j < m; ++j) {
                res += a[i][j] * b[j];
            } int j = 0; int j = 0; j 0 j < m j m ++j ++j j {
                res += a[i][j] * b[j];
            } {
                res += a[i][j] * b[j];
            } res += a[i][j] * b[j] res a[i][j] * b[j] a[i][j] a[i] a i j b[j] b j if (res > 0) {
                ++count;
            } res > 0 res 0 {
                ++count;
            } ++count count System.out.println(count) System.out.println System.out System System.out count String [] args args public class Main {
    public static void main(String [] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int c = scanner.nextInt();
        int [] b = new int[m];
        for (int i = 0; i < m; ++i) {
            b[i] = scanner.nextInt();
        }
        int  [][] a = new int[n][m];
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < m; ++j) {
                a[i][j] = scanner.nextInt();
            }
        }
        int count = 0;
        for (int i = 0; i < n; ++i) {
            long res = c;
            for (int j = 0; j < m; ++j) {
                res += a[i][j] * b[j];
            }
            if (res > 0) {
                ++count;
            }
        }
        System.out.println(count);
    }
} public class Main {
    public static void main(String [] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int c = scanner.nextInt();
        int [] b = new int[m];
        for (int i = 0; i < m; ++i) {
            b[i] = scanner.nextInt();
        }
        int  [][] a = new int[n][m];
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < m; ++j) {
                a[i][j] = scanner.nextInt();
            }
        }
        int count = 0;
        for (int i = 0; i < n; ++i) {
            long res = c;
            for (int j = 0; j < m; ++j) {
                res += a[i][j] * b[j];
            }
            if (res > 0) {
                ++count;
            }
        }
        System.out.println(count);
    }
} Main

import java.util.Scanner;

public class Main {
    public static void main(String [] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int c = scanner.nextInt();
        int [] b = new int[m];
        for (int i = 0; i < m; ++i) {
            b[i] = scanner.nextInt();
        }
        int  [][] a = new int[n][m];
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < m; ++j) {
                a[i][j] = scanner.nextInt();
            }
        }
        int count = 0;
        for (int i = 0; i < n; ++i) {
            long res = c;
            for (int j = 0; j < m; ++j) {
                res += a[i][j] * b[j];
            }
            if (res > 0) {
                ++count;
            }
        }
        System.out.println(count);
    }
}
