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 counter = 0;
   	int B[] = new int[M];
    
    for(int i=0; i<M; i++) {
      B[i] = sc.nextInt();
    }
    
    for(int j=0; j<N; j++) {
      int total = C;
      for(int k=0; k<M; k++) {
        total += sc.nextInt() * B[k];
      }
      if(total > 0) {
        counter++;
      }
    }
    System.out.println(counter);
  }
} 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 counter = 0;
   	int B[] = new int[M];
    
    for(int i=0; i<M; i++) {
      B[i] = sc.nextInt();
    }
    
    for(int j=0; j<N; j++) {
      int total = C;
      for(int k=0; k<M; k++) {
        total += sc.nextInt() * B[k];
      }
      if(total > 0) {
        counter++;
      }
    }
    System.out.println(counter);
  }
} 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 counter = 0;
   	int B[] = new int[M];
    
    for(int i=0; i<M; i++) {
      B[i] = sc.nextInt();
    }
    
    for(int j=0; j<N; j++) {
      int total = C;
      for(int k=0; k<M; k++) {
        total += sc.nextInt() * B[k];
      }
      if(total > 0) {
        counter++;
      }
    }
    System.out.println(counter);
  } main {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int C = sc.nextInt();
    int counter = 0;
   	int B[] = new int[M];
    
    for(int i=0; i<M; i++) {
      B[i] = sc.nextInt();
    }
    
    for(int j=0; j<N; j++) {
      int total = C;
      for(int k=0; k<M; k++) {
        total += sc.nextInt() * B[k];
      }
      if(total > 0) {
        counter++;
      }
    }
    System.out.println(counter);
  } 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 counter = 0; counter 0 int B[] = new int[M]; B new int[M] M 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] = sc.nextInt() B[i] B i sc.nextInt() sc.nextInt sc for(int j=0; j<N; j++) {
      int total = C;
      for(int k=0; k<M; k++) {
        total += sc.nextInt() * B[k];
      }
      if(total > 0) {
        counter++;
      }
    } int j=0; int j=0; j 0 j<N j N j++ j++ j {
      int total = C;
      for(int k=0; k<M; k++) {
        total += sc.nextInt() * B[k];
      }
      if(total > 0) {
        counter++;
      }
    } {
      int total = C;
      for(int k=0; k<M; k++) {
        total += sc.nextInt() * B[k];
      }
      if(total > 0) {
        counter++;
      }
    } int total = C; total C for(int k=0; k<M; k++) {
        total += sc.nextInt() * B[k];
      } int k=0; int k=0; k 0 k<M k M k++ k++ k {
        total += sc.nextInt() * B[k];
      } {
        total += sc.nextInt() * B[k];
      } total += sc.nextInt() * B[k] total sc.nextInt() * B[k] sc.nextInt() sc.nextInt sc B[k] B k if(total > 0) {
        counter++;
      } total > 0 total 0 {
        counter++;
      } counter++ counter System.out.println(counter) System.out.println System.out System System.out counter 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 counter = 0;
   	int B[] = new int[M];
    
    for(int i=0; i<M; i++) {
      B[i] = sc.nextInt();
    }
    
    for(int j=0; j<N; j++) {
      int total = C;
      for(int k=0; k<M; k++) {
        total += sc.nextInt() * B[k];
      }
      if(total > 0) {
        counter++;
      }
    }
    System.out.println(counter);
  }
} 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 counter = 0;
   	int B[] = new int[M];
    
    for(int i=0; i<M; i++) {
      B[i] = sc.nextInt();
    }
    
    for(int j=0; j<N; j++) {
      int total = C;
      for(int k=0; k<M; k++) {
        total += sc.nextInt() * B[k];
      }
      if(total > 0) {
        counter++;
      }
    }
    System.out.println(counter);
  }
} Main
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 counter = 0;
   	int B[] = new int[M];
    
    for(int i=0; i<M; i++) {
      B[i] = sc.nextInt();
    }
    
    for(int j=0; j<N; j++) {
      int total = C;
      for(int k=0; k<M; k++) {
        total += sc.nextInt() * B[k];
      }
      if(total > 0) {
        counter++;
      }
    }
    System.out.println(counter);
  }
}
