import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
      Scanner sc=new Scanner(System.in);
      String[] param = sc.nextLine().split(" ");
      Integer N = Integer.parseInt(param[0]);
      Integer M = Integer.parseInt(param[1]);
      Integer C = Integer.parseInt(param[2]);
      
      String[] strB = sc.nextLine().split(" ");
      List<Integer> A = new ArrayList<>();
      List<Integer> B = new ArrayList<>();
      for(String b : strB) {
        B.add(Integer.parseInt(b));
        A.add(0);
      }
      
      int counter = 0;
      for(int index=0; index<N; index++) {
        int chk = 0;
        String[] strA = sc.nextLine().split(" ");
        for(int inner=0; inner<M; inner++) {
          A.set(inner, Integer.parseInt(strA[inner]));
          chk += A.get(inner) * B.get(inner);
        }
        
        chk += C;
        if( chk > 0 ) { counter++; }
      }
      
      System.out.println(counter);

    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        
      Scanner sc=new Scanner(System.in);
      String[] param = sc.nextLine().split(" ");
      Integer N = Integer.parseInt(param[0]);
      Integer M = Integer.parseInt(param[1]);
      Integer C = Integer.parseInt(param[2]);
      
      String[] strB = sc.nextLine().split(" ");
      List<Integer> A = new ArrayList<>();
      List<Integer> B = new ArrayList<>();
      for(String b : strB) {
        B.add(Integer.parseInt(b));
        A.add(0);
      }
      
      int counter = 0;
      for(int index=0; index<N; index++) {
        int chk = 0;
        String[] strA = sc.nextLine().split(" ");
        for(int inner=0; inner<M; inner++) {
          A.set(inner, Integer.parseInt(strA[inner]));
          chk += A.get(inner) * B.get(inner);
        }
        
        chk += C;
        if( chk > 0 ) { counter++; }
      }
      
      System.out.println(counter);

    }
} Main public static void main(String[] args) throws Exception {
        
      Scanner sc=new Scanner(System.in);
      String[] param = sc.nextLine().split(" ");
      Integer N = Integer.parseInt(param[0]);
      Integer M = Integer.parseInt(param[1]);
      Integer C = Integer.parseInt(param[2]);
      
      String[] strB = sc.nextLine().split(" ");
      List<Integer> A = new ArrayList<>();
      List<Integer> B = new ArrayList<>();
      for(String b : strB) {
        B.add(Integer.parseInt(b));
        A.add(0);
      }
      
      int counter = 0;
      for(int index=0; index<N; index++) {
        int chk = 0;
        String[] strA = sc.nextLine().split(" ");
        for(int inner=0; inner<M; inner++) {
          A.set(inner, Integer.parseInt(strA[inner]));
          chk += A.get(inner) * B.get(inner);
        }
        
        chk += C;
        if( chk > 0 ) { counter++; }
      }
      
      System.out.println(counter);

    } main {
        
      Scanner sc=new Scanner(System.in);
      String[] param = sc.nextLine().split(" ");
      Integer N = Integer.parseInt(param[0]);
      Integer M = Integer.parseInt(param[1]);
      Integer C = Integer.parseInt(param[2]);
      
      String[] strB = sc.nextLine().split(" ");
      List<Integer> A = new ArrayList<>();
      List<Integer> B = new ArrayList<>();
      for(String b : strB) {
        B.add(Integer.parseInt(b));
        A.add(0);
      }
      
      int counter = 0;
      for(int index=0; index<N; index++) {
        int chk = 0;
        String[] strA = sc.nextLine().split(" ");
        for(int inner=0; inner<M; inner++) {
          A.set(inner, Integer.parseInt(strA[inner]));
          chk += A.get(inner) * B.get(inner);
        }
        
        chk += C;
        if( chk > 0 ) { counter++; }
      }
      
      System.out.println(counter);

    } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) String[] param = sc.nextLine().split(" "); param sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " Integer N = Integer.parseInt(param[0]); N Integer.parseInt(param[0]) Integer.parseInt Integer param[0] param 0 Integer M = Integer.parseInt(param[1]); M Integer.parseInt(param[1]) Integer.parseInt Integer param[1] param 1 Integer C = Integer.parseInt(param[2]); C Integer.parseInt(param[2]) Integer.parseInt Integer param[2] param 2 String[] strB = sc.nextLine().split(" "); strB sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " List<Integer> A = new ArrayList<>(); A new ArrayList<>() List<Integer> B = new ArrayList<>(); B new ArrayList<>() for(String b : strB) {
        B.add(Integer.parseInt(b));
        A.add(0);
      } String b strB {
        B.add(Integer.parseInt(b));
        A.add(0);
      } {
        B.add(Integer.parseInt(b));
        A.add(0);
      } B.add(Integer.parseInt(b)) B.add B Integer.parseInt(b) Integer.parseInt Integer b A.add(0) A.add A 0 int counter = 0; counter 0 for(int index=0; index<N; index++) {
        int chk = 0;
        String[] strA = sc.nextLine().split(" ");
        for(int inner=0; inner<M; inner++) {
          A.set(inner, Integer.parseInt(strA[inner]));
          chk += A.get(inner) * B.get(inner);
        }
        
        chk += C;
        if( chk > 0 ) { counter++; }
      } int index=0; int index=0; index 0 index<N index N index++ index++ index {
        int chk = 0;
        String[] strA = sc.nextLine().split(" ");
        for(int inner=0; inner<M; inner++) {
          A.set(inner, Integer.parseInt(strA[inner]));
          chk += A.get(inner) * B.get(inner);
        }
        
        chk += C;
        if( chk > 0 ) { counter++; }
      } {
        int chk = 0;
        String[] strA = sc.nextLine().split(" ");
        for(int inner=0; inner<M; inner++) {
          A.set(inner, Integer.parseInt(strA[inner]));
          chk += A.get(inner) * B.get(inner);
        }
        
        chk += C;
        if( chk > 0 ) { counter++; }
      } int chk = 0; chk 0 String[] strA = sc.nextLine().split(" "); strA sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " for(int inner=0; inner<M; inner++) {
          A.set(inner, Integer.parseInt(strA[inner]));
          chk += A.get(inner) * B.get(inner);
        } int inner=0; int inner=0; inner 0 inner<M inner M inner++ inner++ inner {
          A.set(inner, Integer.parseInt(strA[inner]));
          chk += A.get(inner) * B.get(inner);
        } {
          A.set(inner, Integer.parseInt(strA[inner]));
          chk += A.get(inner) * B.get(inner);
        } A.set(inner, Integer.parseInt(strA[inner])) A.set A inner Integer.parseInt(strA[inner]) Integer.parseInt Integer strA[inner] strA inner chk += A.get(inner) * B.get(inner) chk A.get(inner) * B.get(inner) A.get(inner) A.get A inner B.get(inner) B.get B inner chk += C chk C if( chk > 0 ) { counter++; } chk > 0 chk 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) throws Exception {
        
      Scanner sc=new Scanner(System.in);
      String[] param = sc.nextLine().split(" ");
      Integer N = Integer.parseInt(param[0]);
      Integer M = Integer.parseInt(param[1]);
      Integer C = Integer.parseInt(param[2]);
      
      String[] strB = sc.nextLine().split(" ");
      List<Integer> A = new ArrayList<>();
      List<Integer> B = new ArrayList<>();
      for(String b : strB) {
        B.add(Integer.parseInt(b));
        A.add(0);
      }
      
      int counter = 0;
      for(int index=0; index<N; index++) {
        int chk = 0;
        String[] strA = sc.nextLine().split(" ");
        for(int inner=0; inner<M; inner++) {
          A.set(inner, Integer.parseInt(strA[inner]));
          chk += A.get(inner) * B.get(inner);
        }
        
        chk += C;
        if( chk > 0 ) { counter++; }
      }
      
      System.out.println(counter);

    }
} public class Main {
    public static void main(String[] args) throws Exception {
        
      Scanner sc=new Scanner(System.in);
      String[] param = sc.nextLine().split(" ");
      Integer N = Integer.parseInt(param[0]);
      Integer M = Integer.parseInt(param[1]);
      Integer C = Integer.parseInt(param[2]);
      
      String[] strB = sc.nextLine().split(" ");
      List<Integer> A = new ArrayList<>();
      List<Integer> B = new ArrayList<>();
      for(String b : strB) {
        B.add(Integer.parseInt(b));
        A.add(0);
      }
      
      int counter = 0;
      for(int index=0; index<N; index++) {
        int chk = 0;
        String[] strA = sc.nextLine().split(" ");
        for(int inner=0; inner<M; inner++) {
          A.set(inner, Integer.parseInt(strA[inner]));
          chk += A.get(inner) * B.get(inner);
        }
        
        chk += C;
        if( chk > 0 ) { counter++; }
      }
      
      System.out.println(counter);

    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
      Scanner sc=new Scanner(System.in);
      String[] param = sc.nextLine().split(" ");
      Integer N = Integer.parseInt(param[0]);
      Integer M = Integer.parseInt(param[1]);
      Integer C = Integer.parseInt(param[2]);
      
      String[] strB = sc.nextLine().split(" ");
      List<Integer> A = new ArrayList<>();
      List<Integer> B = new ArrayList<>();
      for(String b : strB) {
        B.add(Integer.parseInt(b));
        A.add(0);
      }
      
      int counter = 0;
      for(int index=0; index<N; index++) {
        int chk = 0;
        String[] strA = sc.nextLine().split(" ");
        for(int inner=0; inner<M; inner++) {
          A.set(inner, Integer.parseInt(strA[inner]));
          chk += A.get(inner) * B.get(inner);
        }
        
        chk += C;
        if( chk > 0 ) { counter++; }
      }
      
      System.out.println(counter);

    }
}
