import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
  private static final String DELIMITER = " ";

  /**
   * Ai1B1 + Ai2B2 + ... + C > 0
   *
   * 2 3 -10
   * 1 2 3
   * 3 2 1
   * 1 2 2
   *
   * @param args
   */
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    String firstLine = scanner.nextLine();
    String[] firstArray = firstLine.split(DELIMITER);
    int n = Integer.valueOf(firstArray[0]);
    int m = Integer.valueOf(firstArray[1]);
    int c = Integer.valueOf(firstArray[2]);

    String secondLine = scanner.nextLine();
    String[] secondArray = secondLine.split(DELIMITER);

    List<Integer> ok = new ArrayList<>();

    while (scanner.hasNext()) {
      String line = scanner.nextLine();
      int sum = 0;
      String[] lineArray = line.split(DELIMITER);
      for (int i = 0; i < m; i ++) {
        sum += Integer.valueOf(lineArray[i]) *  Integer.valueOf(secondArray[i]);
      }
      if (sum + c > 0) ok.add(0);
    }

    System.out.println(ok.size());
  }
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {
  private static final String DELIMITER = " ";

  /**
   * Ai1B1 + Ai2B2 + ... + C > 0
   *
   * 2 3 -10
   * 1 2 3
   * 3 2 1
   * 1 2 2
   *
   * @param args
   */
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    String firstLine = scanner.nextLine();
    String[] firstArray = firstLine.split(DELIMITER);
    int n = Integer.valueOf(firstArray[0]);
    int m = Integer.valueOf(firstArray[1]);
    int c = Integer.valueOf(firstArray[2]);

    String secondLine = scanner.nextLine();
    String[] secondArray = secondLine.split(DELIMITER);

    List<Integer> ok = new ArrayList<>();

    while (scanner.hasNext()) {
      String line = scanner.nextLine();
      int sum = 0;
      String[] lineArray = line.split(DELIMITER);
      for (int i = 0; i < m; i ++) {
        sum += Integer.valueOf(lineArray[i]) *  Integer.valueOf(secondArray[i]);
      }
      if (sum + c > 0) ok.add(0);
    }

    System.out.println(ok.size());
  }
} Main private static final String DELIMITER = " "; DELIMITER " " /**
   * Ai1B1 + Ai2B2 + ... + C > 0
   *
   * 2 3 -10
   * 1 2 3
   * 3 2 1
   * 1 2 2
   *
   * @param args
   */
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    String firstLine = scanner.nextLine();
    String[] firstArray = firstLine.split(DELIMITER);
    int n = Integer.valueOf(firstArray[0]);
    int m = Integer.valueOf(firstArray[1]);
    int c = Integer.valueOf(firstArray[2]);

    String secondLine = scanner.nextLine();
    String[] secondArray = secondLine.split(DELIMITER);

    List<Integer> ok = new ArrayList<>();

    while (scanner.hasNext()) {
      String line = scanner.nextLine();
      int sum = 0;
      String[] lineArray = line.split(DELIMITER);
      for (int i = 0; i < m; i ++) {
        sum += Integer.valueOf(lineArray[i]) *  Integer.valueOf(secondArray[i]);
      }
      if (sum + c > 0) ok.add(0);
    }

    System.out.println(ok.size());
  } main {
    Scanner scanner = new Scanner(System.in);
    String firstLine = scanner.nextLine();
    String[] firstArray = firstLine.split(DELIMITER);
    int n = Integer.valueOf(firstArray[0]);
    int m = Integer.valueOf(firstArray[1]);
    int c = Integer.valueOf(firstArray[2]);

    String secondLine = scanner.nextLine();
    String[] secondArray = secondLine.split(DELIMITER);

    List<Integer> ok = new ArrayList<>();

    while (scanner.hasNext()) {
      String line = scanner.nextLine();
      int sum = 0;
      String[] lineArray = line.split(DELIMITER);
      for (int i = 0; i < m; i ++) {
        sum += Integer.valueOf(lineArray[i]) *  Integer.valueOf(secondArray[i]);
      }
      if (sum + c > 0) ok.add(0);
    }

    System.out.println(ok.size());
  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String firstLine = scanner.nextLine(); firstLine scanner.nextLine() scanner.nextLine scanner String[] firstArray = firstLine.split(DELIMITER); firstArray firstLine.split(DELIMITER) firstLine.split firstLine DELIMITER int n = Integer.valueOf(firstArray[0]); n Integer.valueOf(firstArray[0]) Integer.valueOf Integer firstArray[0] firstArray 0 int m = Integer.valueOf(firstArray[1]); m Integer.valueOf(firstArray[1]) Integer.valueOf Integer firstArray[1] firstArray 1 int c = Integer.valueOf(firstArray[2]); c Integer.valueOf(firstArray[2]) Integer.valueOf Integer firstArray[2] firstArray 2 String secondLine = scanner.nextLine(); secondLine scanner.nextLine() scanner.nextLine scanner String[] secondArray = secondLine.split(DELIMITER); secondArray secondLine.split(DELIMITER) secondLine.split secondLine DELIMITER List<Integer> ok = new ArrayList<>(); ok new ArrayList<>() while (scanner.hasNext()) {
      String line = scanner.nextLine();
      int sum = 0;
      String[] lineArray = line.split(DELIMITER);
      for (int i = 0; i < m; i ++) {
        sum += Integer.valueOf(lineArray[i]) *  Integer.valueOf(secondArray[i]);
      }
      if (sum + c > 0) ok.add(0);
    } scanner.hasNext() scanner.hasNext scanner {
      String line = scanner.nextLine();
      int sum = 0;
      String[] lineArray = line.split(DELIMITER);
      for (int i = 0; i < m; i ++) {
        sum += Integer.valueOf(lineArray[i]) *  Integer.valueOf(secondArray[i]);
      }
      if (sum + c > 0) ok.add(0);
    } String line = scanner.nextLine(); line scanner.nextLine() scanner.nextLine scanner int sum = 0; sum 0 String[] lineArray = line.split(DELIMITER); lineArray line.split(DELIMITER) line.split line DELIMITER for (int i = 0; i < m; i ++) {
        sum += Integer.valueOf(lineArray[i]) *  Integer.valueOf(secondArray[i]);
      } int i = 0; int i = 0; i 0 i < m i m i ++ i ++ i {
        sum += Integer.valueOf(lineArray[i]) *  Integer.valueOf(secondArray[i]);
      } {
        sum += Integer.valueOf(lineArray[i]) *  Integer.valueOf(secondArray[i]);
      } sum += Integer.valueOf(lineArray[i]) *  Integer.valueOf(secondArray[i]) sum Integer.valueOf(lineArray[i]) *  Integer.valueOf(secondArray[i]) Integer.valueOf(lineArray[i]) Integer.valueOf Integer lineArray[i] lineArray i Integer.valueOf(secondArray[i]) Integer.valueOf Integer secondArray[i] secondArray i if (sum + c > 0) ok.add(0); sum + c > 0 sum + c sum c 0 ok.add(0) ok.add ok 0 System.out.println(ok.size()) System.out.println System.out System System.out ok.size() ok.size ok String[] args args public class Main {
  private static final String DELIMITER = " ";

  /**
   * Ai1B1 + Ai2B2 + ... + C > 0
   *
   * 2 3 -10
   * 1 2 3
   * 3 2 1
   * 1 2 2
   *
   * @param args
   */
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    String firstLine = scanner.nextLine();
    String[] firstArray = firstLine.split(DELIMITER);
    int n = Integer.valueOf(firstArray[0]);
    int m = Integer.valueOf(firstArray[1]);
    int c = Integer.valueOf(firstArray[2]);

    String secondLine = scanner.nextLine();
    String[] secondArray = secondLine.split(DELIMITER);

    List<Integer> ok = new ArrayList<>();

    while (scanner.hasNext()) {
      String line = scanner.nextLine();
      int sum = 0;
      String[] lineArray = line.split(DELIMITER);
      for (int i = 0; i < m; i ++) {
        sum += Integer.valueOf(lineArray[i]) *  Integer.valueOf(secondArray[i]);
      }
      if (sum + c > 0) ok.add(0);
    }

    System.out.println(ok.size());
  }
} public class Main {
  private static final String DELIMITER = " ";

  /**
   * Ai1B1 + Ai2B2 + ... + C > 0
   *
   * 2 3 -10
   * 1 2 3
   * 3 2 1
   * 1 2 2
   *
   * @param args
   */
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    String firstLine = scanner.nextLine();
    String[] firstArray = firstLine.split(DELIMITER);
    int n = Integer.valueOf(firstArray[0]);
    int m = Integer.valueOf(firstArray[1]);
    int c = Integer.valueOf(firstArray[2]);

    String secondLine = scanner.nextLine();
    String[] secondArray = secondLine.split(DELIMITER);

    List<Integer> ok = new ArrayList<>();

    while (scanner.hasNext()) {
      String line = scanner.nextLine();
      int sum = 0;
      String[] lineArray = line.split(DELIMITER);
      for (int i = 0; i < m; i ++) {
        sum += Integer.valueOf(lineArray[i]) *  Integer.valueOf(secondArray[i]);
      }
      if (sum + c > 0) ok.add(0);
    }

    System.out.println(ok.size());
  }
} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
  private static final String DELIMITER = " ";

  /**
   * Ai1B1 + Ai2B2 + ... + C > 0
   *
   * 2 3 -10
   * 1 2 3
   * 3 2 1
   * 1 2 2
   *
   * @param args
   */
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    String firstLine = scanner.nextLine();
    String[] firstArray = firstLine.split(DELIMITER);
    int n = Integer.valueOf(firstArray[0]);
    int m = Integer.valueOf(firstArray[1]);
    int c = Integer.valueOf(firstArray[2]);

    String secondLine = scanner.nextLine();
    String[] secondArray = secondLine.split(DELIMITER);

    List<Integer> ok = new ArrayList<>();

    while (scanner.hasNext()) {
      String line = scanner.nextLine();
      int sum = 0;
      String[] lineArray = line.split(DELIMITER);
      for (int i = 0; i < m; i ++) {
        sum += Integer.valueOf(lineArray[i]) *  Integer.valueOf(secondArray[i]);
      }
      if (sum + c > 0) ok.add(0);
    }

    System.out.println(ok.size());
  }
}
