import java.util.Scanner;

public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int M = in.nextInt();
      int C = in.nextInt();
      int[] B = new int[M];

      for (int i = 0; i < B.length; ++i) {
        B[i] = in.nextInt();
      }

      int countSol = 0;
      for (int i = 0; i < N; ++i) {
        int sum = C;
        for (int j = 0; j < M; ++j) {
          sum += B[j] * in.nextInt();
        }
        
        if (sum > 0) {
          ++countSol;
        }
      }

      System.out.println(countSol);
    }
  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int M = in.nextInt();
      int C = in.nextInt();
      int[] B = new int[M];

      for (int i = 0; i < B.length; ++i) {
        B[i] = in.nextInt();
      }

      int countSol = 0;
      for (int i = 0; i < N; ++i) {
        int sum = C;
        for (int j = 0; j < M; ++j) {
          sum += B[j] * in.nextInt();
        }
        
        if (sum > 0) {
          ++countSol;
        }
      }

      System.out.println(countSol);
    }
  }
} Main public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int M = in.nextInt();
      int C = in.nextInt();
      int[] B = new int[M];

      for (int i = 0; i < B.length; ++i) {
        B[i] = in.nextInt();
      }

      int countSol = 0;
      for (int i = 0; i < N; ++i) {
        int sum = C;
        for (int j = 0; j < M; ++j) {
          sum += B[j] * in.nextInt();
        }
        
        if (sum > 0) {
          ++countSol;
        }
      }

      System.out.println(countSol);
    }
  } main {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int M = in.nextInt();
      int C = in.nextInt();
      int[] B = new int[M];

      for (int i = 0; i < B.length; ++i) {
        B[i] = in.nextInt();
      }

      int countSol = 0;
      for (int i = 0; i < N; ++i) {
        int sum = C;
        for (int j = 0; j < M; ++j) {
          sum += B[j] * in.nextInt();
        }
        
        if (sum > 0) {
          ++countSol;
        }
      }

      System.out.println(countSol);
    }
  } Scanner in = new Scanner(System.in); in new Scanner(System.in) while (in.hasNext()) {
      int N = in.nextInt();
      int M = in.nextInt();
      int C = in.nextInt();
      int[] B = new int[M];

      for (int i = 0; i < B.length; ++i) {
        B[i] = in.nextInt();
      }

      int countSol = 0;
      for (int i = 0; i < N; ++i) {
        int sum = C;
        for (int j = 0; j < M; ++j) {
          sum += B[j] * in.nextInt();
        }
        
        if (sum > 0) {
          ++countSol;
        }
      }

      System.out.println(countSol);
    } in.hasNext() in.hasNext in {
      int N = in.nextInt();
      int M = in.nextInt();
      int C = in.nextInt();
      int[] B = new int[M];

      for (int i = 0; i < B.length; ++i) {
        B[i] = in.nextInt();
      }

      int countSol = 0;
      for (int i = 0; i < N; ++i) {
        int sum = C;
        for (int j = 0; j < M; ++j) {
          sum += B[j] * in.nextInt();
        }
        
        if (sum > 0) {
          ++countSol;
        }
      }

      System.out.println(countSol);
    } int N = in.nextInt(); N in.nextInt() in.nextInt in int M = in.nextInt(); M in.nextInt() in.nextInt in int C = in.nextInt(); C in.nextInt() in.nextInt in int[] B = new int[M]; B new int[M] M for (int i = 0; i < B.length; ++i) {
        B[i] = in.nextInt();
      } int i = 0; int i = 0; i 0 i < B.length i B.length B B.length ++i ++i i {
        B[i] = in.nextInt();
      } {
        B[i] = in.nextInt();
      } B[i] = in.nextInt() B[i] B i in.nextInt() in.nextInt in int countSol = 0; countSol 0 for (int i = 0; i < N; ++i) {
        int sum = C;
        for (int j = 0; j < M; ++j) {
          sum += B[j] * in.nextInt();
        }
        
        if (sum > 0) {
          ++countSol;
        }
      } int i = 0; int i = 0; i 0 i < N i N ++i ++i i {
        int sum = C;
        for (int j = 0; j < M; ++j) {
          sum += B[j] * in.nextInt();
        }
        
        if (sum > 0) {
          ++countSol;
        }
      } {
        int sum = C;
        for (int j = 0; j < M; ++j) {
          sum += B[j] * in.nextInt();
        }
        
        if (sum > 0) {
          ++countSol;
        }
      } int sum = C; sum C for (int j = 0; j < M; ++j) {
          sum += B[j] * in.nextInt();
        } int j = 0; int j = 0; j 0 j < M j M ++j ++j j {
          sum += B[j] * in.nextInt();
        } {
          sum += B[j] * in.nextInt();
        } sum += B[j] * in.nextInt() sum B[j] * in.nextInt() B[j] B j in.nextInt() in.nextInt in if (sum > 0) {
          ++countSol;
        } sum > 0 sum 0 {
          ++countSol;
        } ++countSol countSol System.out.println(countSol) System.out.println System.out System System.out countSol String[] args args public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int M = in.nextInt();
      int C = in.nextInt();
      int[] B = new int[M];

      for (int i = 0; i < B.length; ++i) {
        B[i] = in.nextInt();
      }

      int countSol = 0;
      for (int i = 0; i < N; ++i) {
        int sum = C;
        for (int j = 0; j < M; ++j) {
          sum += B[j] * in.nextInt();
        }
        
        if (sum > 0) {
          ++countSol;
        }
      }

      System.out.println(countSol);
    }
  }
} public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int M = in.nextInt();
      int C = in.nextInt();
      int[] B = new int[M];

      for (int i = 0; i < B.length; ++i) {
        B[i] = in.nextInt();
      }

      int countSol = 0;
      for (int i = 0; i < N; ++i) {
        int sum = C;
        for (int j = 0; j < M; ++j) {
          sum += B[j] * in.nextInt();
        }
        
        if (sum > 0) {
          ++countSol;
        }
      }

      System.out.println(countSol);
    }
  }
} Main
import java.util.Scanner;

public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int M = in.nextInt();
      int C = in.nextInt();
      int[] B = new int[M];

      for (int i = 0; i < B.length; ++i) {
        B[i] = in.nextInt();
      }

      int countSol = 0;
      for (int i = 0; i < N; ++i) {
        int sum = C;
        for (int j = 0; j < M; ++j) {
          sum += B[j] * in.nextInt();
        }
        
        if (sum > 0) {
          ++countSol;
        }
      }

      System.out.println(countSol);
    }
  }
}