import java.util.*;
 
class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int rows = scanner.nextInt();
    int cols = scanner.nextInt();
    int constant = scanner.nextInt();
    
    int[] code = new int[cols];
    for (int ix = 0; ix < cols; ix++) {
      code[ix] = scanner.nextInt();
    }
    
    int matches = 0;
    for (int row = 0; row < rows; row++) {
      int result = 0;
      for (int col = 0; col < cols; col++) {
        result += scanner.nextInt() * code[col];
      }
      
      if (result + constant > 0) matches++;
    }
    
    System.out.println(matches);
  }
} import java.util.*; util.* java class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int rows = scanner.nextInt();
    int cols = scanner.nextInt();
    int constant = scanner.nextInt();
    
    int[] code = new int[cols];
    for (int ix = 0; ix < cols; ix++) {
      code[ix] = scanner.nextInt();
    }
    
    int matches = 0;
    for (int row = 0; row < rows; row++) {
      int result = 0;
      for (int col = 0; col < cols; col++) {
        result += scanner.nextInt() * code[col];
      }
      
      if (result + constant > 0) matches++;
    }
    
    System.out.println(matches);
  }
} Main public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int rows = scanner.nextInt();
    int cols = scanner.nextInt();
    int constant = scanner.nextInt();
    
    int[] code = new int[cols];
    for (int ix = 0; ix < cols; ix++) {
      code[ix] = scanner.nextInt();
    }
    
    int matches = 0;
    for (int row = 0; row < rows; row++) {
      int result = 0;
      for (int col = 0; col < cols; col++) {
        result += scanner.nextInt() * code[col];
      }
      
      if (result + constant > 0) matches++;
    }
    
    System.out.println(matches);
  } main {
    Scanner scanner = new Scanner(System.in);
    int rows = scanner.nextInt();
    int cols = scanner.nextInt();
    int constant = scanner.nextInt();
    
    int[] code = new int[cols];
    for (int ix = 0; ix < cols; ix++) {
      code[ix] = scanner.nextInt();
    }
    
    int matches = 0;
    for (int row = 0; row < rows; row++) {
      int result = 0;
      for (int col = 0; col < cols; col++) {
        result += scanner.nextInt() * code[col];
      }
      
      if (result + constant > 0) matches++;
    }
    
    System.out.println(matches);
  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int rows = scanner.nextInt(); rows scanner.nextInt() scanner.nextInt scanner int cols = scanner.nextInt(); cols scanner.nextInt() scanner.nextInt scanner int constant = scanner.nextInt(); constant scanner.nextInt() scanner.nextInt scanner int[] code = new int[cols]; code new int[cols] cols for (int ix = 0; ix < cols; ix++) {
      code[ix] = scanner.nextInt();
    } int ix = 0; int ix = 0; ix 0 ix < cols ix cols ix++ ix++ ix {
      code[ix] = scanner.nextInt();
    } {
      code[ix] = scanner.nextInt();
    } code[ix] = scanner.nextInt() code[ix] code ix scanner.nextInt() scanner.nextInt scanner int matches = 0; matches 0 for (int row = 0; row < rows; row++) {
      int result = 0;
      for (int col = 0; col < cols; col++) {
        result += scanner.nextInt() * code[col];
      }
      
      if (result + constant > 0) matches++;
    } int row = 0; int row = 0; row 0 row < rows row rows row++ row++ row {
      int result = 0;
      for (int col = 0; col < cols; col++) {
        result += scanner.nextInt() * code[col];
      }
      
      if (result + constant > 0) matches++;
    } {
      int result = 0;
      for (int col = 0; col < cols; col++) {
        result += scanner.nextInt() * code[col];
      }
      
      if (result + constant > 0) matches++;
    } int result = 0; result 0 for (int col = 0; col < cols; col++) {
        result += scanner.nextInt() * code[col];
      } int col = 0; int col = 0; col 0 col < cols col cols col++ col++ col {
        result += scanner.nextInt() * code[col];
      } {
        result += scanner.nextInt() * code[col];
      } result += scanner.nextInt() * code[col] result scanner.nextInt() * code[col] scanner.nextInt() scanner.nextInt scanner code[col] code col if (result + constant > 0) matches++; result + constant > 0 result + constant result constant 0 matches++ matches System.out.println(matches) System.out.println System.out System System.out matches String[] args args
import java.util.*;
 
class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int rows = scanner.nextInt();
    int cols = scanner.nextInt();
    int constant = scanner.nextInt();
    
    int[] code = new int[cols];
    for (int ix = 0; ix < cols; ix++) {
      code[ix] = scanner.nextInt();
    }
    
    int matches = 0;
    for (int row = 0; row < rows; row++) {
      int result = 0;
      for (int col = 0; col < cols; col++) {
        result += scanner.nextInt() * code[col];
      }
      
      if (result + constant > 0) matches++;
    }
    
    System.out.println(matches);
  }
}