import java.io.*;
import java.util.*;

public class Main {
  private static boolean positive(int[] bs, int[] as, int c) {
    int sum = c;
    for (int i = 0; i < bs.length; i++) {
      sum += bs[i] * as[i];
    }
    return sum > 0;
  }
  
  private static int solve(int n, int m, int c, int[] bs, int[][] as) {
    int count = 0;
    for (int[] ai : as) {
      if (positive(bs, ai, c)) {
        count++;
      }
    }
    return count;
  }
  
  private static void execute(ContestReader reader, PrintWriter out) {
    int n = reader.nextInt();
    int m = reader.nextInt();
    int c = reader.nextInt();
    int[] bs = reader.nextIntArray(m);
    int[][] as = reader.nextIntMatrix(n, m);
    out.println(solve(n, m, c, bs, as));
  }
  
  public static void main(String[] args) {
    ContestReader reader = new ContestReader(System.in);
    PrintWriter out = new PrintWriter(System.out);
    execute(reader, out);
    out.flush();
  }
}

class ContestReader {
  private BufferedReader reader;
  private StringTokenizer tokenizer;
  
  ContestReader(InputStream in) {
    reader = new BufferedReader(new InputStreamReader(in));
  }
  
  public String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }
  
  public int nextInt() {
    return Integer.parseInt(next());
  }
  
  public long nextLong() {
    return Long.parseLong(next());
  }
  
  public double nextDouble() {
    return Double.parseDouble(next());
  }
  
  public int[] nextIntArray(int n) {
    int[] array = new int[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextInt();
    }
    return array;
  }
  
  public long[] nextLongArray(int n) {
    long[] array = new long[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextLong();
    }
    return array;
  }
  
  public int[][] nextIntMatrix(int n, int m) {
    int[][] matrix = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    }
    return matrix;
  }
  
  public long[][] nextLongMatrix(int n, int m) {
    long[][] matrix = new long[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    }
    return matrix;
  }
}

class Algorithm {
  private static void swap(Object[] list, int a, int b) {
    Object tmp = list[a];
    list[a] = list[b];
    list[b] = tmp;
  }
  
  public static <T extends Comparable<? super T>> boolean nextPermutation(T[] ts) {
    int rightMostAscendingOrderIndex = ts.length - 2;
    while (rightMostAscendingOrderIndex >= 0 &&
        ts[rightMostAscendingOrderIndex].compareTo(ts[rightMostAscendingOrderIndex + 1]) >= 0) {
      rightMostAscendingOrderIndex--;
    }
    if (rightMostAscendingOrderIndex < 0) {
      return false;
    }
    
    int rightMostGreatorIndex = ts.length - 1;
    while (ts[rightMostAscendingOrderIndex].compareTo(ts[rightMostGreatorIndex]) >= 0) {
      rightMostGreatorIndex--;
    }
    
    swap(ts, rightMostAscendingOrderIndex, rightMostGreatorIndex);
    for (int i = 0; i < (ts.length - rightMostAscendingOrderIndex - 1) / 2; i++) {
      swap(ts, rightMostAscendingOrderIndex + 1 + i, ts.length - 1 - i);
    }
    return true;
  }
  
  public static void shuffle(int[] array) {
    Random random = new Random();
    int n = array.length;
    for (int i = 0; i < n; i++) {
      int randomIndex = i + random.nextInt(n - i);
      
      int temp = array[i];
      array[i] = array[randomIndex];
      array[randomIndex] = temp;
    }
  }
  
  public static void shuffle(long[] array) {
    Random random = new Random();
    int n = array.length;
    for (int i = 0; i < n; i++) {
      int randomIndex = i + random.nextInt(n - i);
      
      long temp = array[i];
      array[i] = array[randomIndex];
      array[randomIndex] = temp;
    }
  }
  
  public static void sort(int[] array) {
    shuffle(array);
    Arrays.sort(array);
  }
  
  public static void sort(long[] array) {
    shuffle(array);
    Arrays.sort(array);
  }
}
 import java.io.*; io.* java import java.util.*; util.* java public class Main {
  private static boolean positive(int[] bs, int[] as, int c) {
    int sum = c;
    for (int i = 0; i < bs.length; i++) {
      sum += bs[i] * as[i];
    }
    return sum > 0;
  }
  
  private static int solve(int n, int m, int c, int[] bs, int[][] as) {
    int count = 0;
    for (int[] ai : as) {
      if (positive(bs, ai, c)) {
        count++;
      }
    }
    return count;
  }
  
  private static void execute(ContestReader reader, PrintWriter out) {
    int n = reader.nextInt();
    int m = reader.nextInt();
    int c = reader.nextInt();
    int[] bs = reader.nextIntArray(m);
    int[][] as = reader.nextIntMatrix(n, m);
    out.println(solve(n, m, c, bs, as));
  }
  
  public static void main(String[] args) {
    ContestReader reader = new ContestReader(System.in);
    PrintWriter out = new PrintWriter(System.out);
    execute(reader, out);
    out.flush();
  }
} Main private static boolean positive(int[] bs, int[] as, int c) {
    int sum = c;
    for (int i = 0; i < bs.length; i++) {
      sum += bs[i] * as[i];
    }
    return sum > 0;
  } positive {
    int sum = c;
    for (int i = 0; i < bs.length; i++) {
      sum += bs[i] * as[i];
    }
    return sum > 0;
  } int sum = c; sum c for (int i = 0; i < bs.length; i++) {
      sum += bs[i] * as[i];
    } int i = 0; int i = 0; i 0 i < bs.length i bs.length bs bs.length i++ i++ i {
      sum += bs[i] * as[i];
    } {
      sum += bs[i] * as[i];
    } sum += bs[i] * as[i] sum bs[i] * as[i] bs[i] bs i as[i] as i return sum > 0; sum > 0 sum 0 int[] bs bs int[] as as int c c private static int solve(int n, int m, int c, int[] bs, int[][] as) {
    int count = 0;
    for (int[] ai : as) {
      if (positive(bs, ai, c)) {
        count++;
      }
    }
    return count;
  } solve {
    int count = 0;
    for (int[] ai : as) {
      if (positive(bs, ai, c)) {
        count++;
      }
    }
    return count;
  } int count = 0; count 0 for (int[] ai : as) {
      if (positive(bs, ai, c)) {
        count++;
      }
    } int[] ai as {
      if (positive(bs, ai, c)) {
        count++;
      }
    } {
      if (positive(bs, ai, c)) {
        count++;
      }
    } if (positive(bs, ai, c)) {
        count++;
      } positive(bs, ai, c) positive bs ai c {
        count++;
      } count++ count return count; count int n n int m m int c c int[] bs bs int[][] as as private static void execute(ContestReader reader, PrintWriter out) {
    int n = reader.nextInt();
    int m = reader.nextInt();
    int c = reader.nextInt();
    int[] bs = reader.nextIntArray(m);
    int[][] as = reader.nextIntMatrix(n, m);
    out.println(solve(n, m, c, bs, as));
  } execute {
    int n = reader.nextInt();
    int m = reader.nextInt();
    int c = reader.nextInt();
    int[] bs = reader.nextIntArray(m);
    int[][] as = reader.nextIntMatrix(n, m);
    out.println(solve(n, m, c, bs, as));
  } int n = reader.nextInt(); n reader.nextInt() reader.nextInt reader int m = reader.nextInt(); m reader.nextInt() reader.nextInt reader int c = reader.nextInt(); c reader.nextInt() reader.nextInt reader int[] bs = reader.nextIntArray(m); bs reader.nextIntArray(m) reader.nextIntArray reader m int[][] as = reader.nextIntMatrix(n, m); as reader.nextIntMatrix(n, m) reader.nextIntMatrix reader n m out.println(solve(n, m, c, bs, as)) out.println out solve(n, m, c, bs, as) solve n m c bs as ContestReader reader reader PrintWriter out out public static void main(String[] args) {
    ContestReader reader = new ContestReader(System.in);
    PrintWriter out = new PrintWriter(System.out);
    execute(reader, out);
    out.flush();
  } main {
    ContestReader reader = new ContestReader(System.in);
    PrintWriter out = new PrintWriter(System.out);
    execute(reader, out);
    out.flush();
  } ContestReader reader = new ContestReader(System.in); reader new ContestReader(System.in) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) execute(reader, out) execute reader out out.flush() out.flush out String[] args args class ContestReader {
  private BufferedReader reader;
  private StringTokenizer tokenizer;
  
  ContestReader(InputStream in) {
    reader = new BufferedReader(new InputStreamReader(in));
  }
  
  public String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }
  
  public int nextInt() {
    return Integer.parseInt(next());
  }
  
  public long nextLong() {
    return Long.parseLong(next());
  }
  
  public double nextDouble() {
    return Double.parseDouble(next());
  }
  
  public int[] nextIntArray(int n) {
    int[] array = new int[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextInt();
    }
    return array;
  }
  
  public long[] nextLongArray(int n) {
    long[] array = new long[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextLong();
    }
    return array;
  }
  
  public int[][] nextIntMatrix(int n, int m) {
    int[][] matrix = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    }
    return matrix;
  }
  
  public long[][] nextLongMatrix(int n, int m) {
    long[][] matrix = new long[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    }
    return matrix;
  }
} ContestReader private BufferedReader reader; reader private StringTokenizer tokenizer; tokenizer ContestReader(InputStream in) {
    reader = new BufferedReader(new InputStreamReader(in));
  } ContestReader {
    reader = new BufferedReader(new InputStreamReader(in));
  } reader = new BufferedReader(new InputStreamReader(in)) reader new BufferedReader(new InputStreamReader(in)) InputStream in in public String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  } next {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  } while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    } tokenizer == null || !tokenizer.hasMoreTokens() tokenizer == null tokenizer null !tokenizer.hasMoreTokens() tokenizer.hasMoreTokens() tokenizer.hasMoreTokens tokenizer {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    } try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      } catch (Exception e) {
        throw new RuntimeException(e);
      } Exception e {
        throw new RuntimeException(e);
      } throw new RuntimeException(e); new RuntimeException(e) {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } tokenizer = new java.util.StringTokenizer(reader.readLine()) tokenizer new java.util.StringTokenizer(reader.readLine()) return tokenizer.nextToken(); tokenizer.nextToken() tokenizer.nextToken tokenizer public int nextInt() {
    return Integer.parseInt(next());
  } nextInt {
    return Integer.parseInt(next());
  } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public long nextLong() {
    return Long.parseLong(next());
  } nextLong {
    return Long.parseLong(next());
  } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public double nextDouble() {
    return Double.parseDouble(next());
  } nextDouble {
    return Double.parseDouble(next());
  } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next public int[] nextIntArray(int n) {
    int[] array = new int[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextInt();
    }
    return array;
  } nextIntArray {
    int[] array = new int[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextInt();
    }
    return array;
  } int[] array = new int[n]; array new int[n] n for (int i = 0; i < n; i++) {
      array[i] = nextInt();
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      array[i] = nextInt();
    } {
      array[i] = nextInt();
    } array[i] = nextInt() array[i] array i nextInt() nextInt return array; array int n n public long[] nextLongArray(int n) {
    long[] array = new long[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextLong();
    }
    return array;
  } nextLongArray {
    long[] array = new long[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextLong();
    }
    return array;
  } long[] array = new long[n]; array new long[n] n for (int i = 0; i < n; i++) {
      array[i] = nextLong();
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      array[i] = nextLong();
    } {
      array[i] = nextLong();
    } array[i] = nextLong() array[i] array i nextLong() nextLong return array; array int n n public int[][] nextIntMatrix(int n, int m) {
    int[][] matrix = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    }
    return matrix;
  } nextIntMatrix {
    int[][] matrix = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    }
    return matrix;
  } int[][] matrix = new int[n][m]; matrix new int[n][m] n m for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    } {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    } for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      } int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
        matrix[i][j] = nextInt();
      } {
        matrix[i][j] = nextInt();
      } matrix[i][j] = nextInt() matrix[i][j] matrix[i] matrix i j nextInt() nextInt return matrix; matrix int n n int m m public long[][] nextLongMatrix(int n, int m) {
    long[][] matrix = new long[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    }
    return matrix;
  } nextLongMatrix {
    long[][] matrix = new long[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    }
    return matrix;
  } long[][] matrix = new long[n][m]; matrix new long[n][m] n m for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    } {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    } for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      } int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
        matrix[i][j] = nextInt();
      } {
        matrix[i][j] = nextInt();
      } matrix[i][j] = nextInt() matrix[i][j] matrix[i] matrix i j nextInt() nextInt return matrix; matrix int n n int m m class Algorithm {
  private static void swap(Object[] list, int a, int b) {
    Object tmp = list[a];
    list[a] = list[b];
    list[b] = tmp;
  }
  
  public static <T extends Comparable<? super T>> boolean nextPermutation(T[] ts) {
    int rightMostAscendingOrderIndex = ts.length - 2;
    while (rightMostAscendingOrderIndex >= 0 &&
        ts[rightMostAscendingOrderIndex].compareTo(ts[rightMostAscendingOrderIndex + 1]) >= 0) {
      rightMostAscendingOrderIndex--;
    }
    if (rightMostAscendingOrderIndex < 0) {
      return false;
    }
    
    int rightMostGreatorIndex = ts.length - 1;
    while (ts[rightMostAscendingOrderIndex].compareTo(ts[rightMostGreatorIndex]) >= 0) {
      rightMostGreatorIndex--;
    }
    
    swap(ts, rightMostAscendingOrderIndex, rightMostGreatorIndex);
    for (int i = 0; i < (ts.length - rightMostAscendingOrderIndex - 1) / 2; i++) {
      swap(ts, rightMostAscendingOrderIndex + 1 + i, ts.length - 1 - i);
    }
    return true;
  }
  
  public static void shuffle(int[] array) {
    Random random = new Random();
    int n = array.length;
    for (int i = 0; i < n; i++) {
      int randomIndex = i + random.nextInt(n - i);
      
      int temp = array[i];
      array[i] = array[randomIndex];
      array[randomIndex] = temp;
    }
  }
  
  public static void shuffle(long[] array) {
    Random random = new Random();
    int n = array.length;
    for (int i = 0; i < n; i++) {
      int randomIndex = i + random.nextInt(n - i);
      
      long temp = array[i];
      array[i] = array[randomIndex];
      array[randomIndex] = temp;
    }
  }
  
  public static void sort(int[] array) {
    shuffle(array);
    Arrays.sort(array);
  }
  
  public static void sort(long[] array) {
    shuffle(array);
    Arrays.sort(array);
  }
} Algorithm private static void swap(Object[] list, int a, int b) {
    Object tmp = list[a];
    list[a] = list[b];
    list[b] = tmp;
  } swap {
    Object tmp = list[a];
    list[a] = list[b];
    list[b] = tmp;
  } Object tmp = list[a]; tmp list[a] list a list[a] = list[b] list[a] list a list[b] list b list[b] = tmp list[b] list b tmp Object[] list list int a a int b b public static <T extends Comparable<? super T>> boolean nextPermutation(T[] ts) {
    int rightMostAscendingOrderIndex = ts.length - 2;
    while (rightMostAscendingOrderIndex >= 0 &&
        ts[rightMostAscendingOrderIndex].compareTo(ts[rightMostAscendingOrderIndex + 1]) >= 0) {
      rightMostAscendingOrderIndex--;
    }
    if (rightMostAscendingOrderIndex < 0) {
      return false;
    }
    
    int rightMostGreatorIndex = ts.length - 1;
    while (ts[rightMostAscendingOrderIndex].compareTo(ts[rightMostGreatorIndex]) >= 0) {
      rightMostGreatorIndex--;
    }
    
    swap(ts, rightMostAscendingOrderIndex, rightMostGreatorIndex);
    for (int i = 0; i < (ts.length - rightMostAscendingOrderIndex - 1) / 2; i++) {
      swap(ts, rightMostAscendingOrderIndex + 1 + i, ts.length - 1 - i);
    }
    return true;
  } nextPermutation {
    int rightMostAscendingOrderIndex = ts.length - 2;
    while (rightMostAscendingOrderIndex >= 0 &&
        ts[rightMostAscendingOrderIndex].compareTo(ts[rightMostAscendingOrderIndex + 1]) >= 0) {
      rightMostAscendingOrderIndex--;
    }
    if (rightMostAscendingOrderIndex < 0) {
      return false;
    }
    
    int rightMostGreatorIndex = ts.length - 1;
    while (ts[rightMostAscendingOrderIndex].compareTo(ts[rightMostGreatorIndex]) >= 0) {
      rightMostGreatorIndex--;
    }
    
    swap(ts, rightMostAscendingOrderIndex, rightMostGreatorIndex);
    for (int i = 0; i < (ts.length - rightMostAscendingOrderIndex - 1) / 2; i++) {
      swap(ts, rightMostAscendingOrderIndex + 1 + i, ts.length - 1 - i);
    }
    return true;
  } int rightMostAscendingOrderIndex = ts.length - 2; rightMostAscendingOrderIndex ts.length - 2 ts.length ts ts.length 2 while (rightMostAscendingOrderIndex >= 0 &&
        ts[rightMostAscendingOrderIndex].compareTo(ts[rightMostAscendingOrderIndex + 1]) >= 0) {
      rightMostAscendingOrderIndex--;
    } rightMostAscendingOrderIndex >= 0 &&
        ts[rightMostAscendingOrderIndex].compareTo(ts[rightMostAscendingOrderIndex + 1]) >= 0 rightMostAscendingOrderIndex >= 0 rightMostAscendingOrderIndex 0 ts[rightMostAscendingOrderIndex].compareTo(ts[rightMostAscendingOrderIndex + 1]) >= 0 ts[rightMostAscendingOrderIndex].compareTo(ts[rightMostAscendingOrderIndex + 1]) ts[rightMostAscendingOrderIndex].compareTo ts[rightMostAscendingOrderIndex] ts rightMostAscendingOrderIndex ts[rightMostAscendingOrderIndex + 1] ts rightMostAscendingOrderIndex + 1 rightMostAscendingOrderIndex 1 0 {
      rightMostAscendingOrderIndex--;
    } rightMostAscendingOrderIndex-- rightMostAscendingOrderIndex if (rightMostAscendingOrderIndex < 0) {
      return false;
    } rightMostAscendingOrderIndex < 0 rightMostAscendingOrderIndex 0 {
      return false;
    } return false; false int rightMostGreatorIndex = ts.length - 1; rightMostGreatorIndex ts.length - 1 ts.length ts ts.length 1 while (ts[rightMostAscendingOrderIndex].compareTo(ts[rightMostGreatorIndex]) >= 0) {
      rightMostGreatorIndex--;
    } ts[rightMostAscendingOrderIndex].compareTo(ts[rightMostGreatorIndex]) >= 0 ts[rightMostAscendingOrderIndex].compareTo(ts[rightMostGreatorIndex]) ts[rightMostAscendingOrderIndex].compareTo ts[rightMostAscendingOrderIndex] ts rightMostAscendingOrderIndex ts[rightMostGreatorIndex] ts rightMostGreatorIndex 0 {
      rightMostGreatorIndex--;
    } rightMostGreatorIndex-- rightMostGreatorIndex swap(ts, rightMostAscendingOrderIndex, rightMostGreatorIndex) swap ts rightMostAscendingOrderIndex rightMostGreatorIndex for (int i = 0; i < (ts.length - rightMostAscendingOrderIndex - 1) / 2; i++) {
      swap(ts, rightMostAscendingOrderIndex + 1 + i, ts.length - 1 - i);
    } int i = 0; int i = 0; i 0 i < (ts.length - rightMostAscendingOrderIndex - 1) / 2 i (ts.length - rightMostAscendingOrderIndex - 1) / 2 (ts.length - rightMostAscendingOrderIndex - 1) ts.length - rightMostAscendingOrderIndex - 1 ts.length ts ts.length rightMostAscendingOrderIndex 1 2 i++ i++ i {
      swap(ts, rightMostAscendingOrderIndex + 1 + i, ts.length - 1 - i);
    } {
      swap(ts, rightMostAscendingOrderIndex + 1 + i, ts.length - 1 - i);
    } swap(ts, rightMostAscendingOrderIndex + 1 + i, ts.length - 1 - i) swap ts rightMostAscendingOrderIndex + 1 + i rightMostAscendingOrderIndex + 1 + i rightMostAscendingOrderIndex 1 i ts.length - 1 - i ts.length - 1 - i ts.length ts ts.length 1 i return true; true T[] ts ts public static void shuffle(int[] array) {
    Random random = new Random();
    int n = array.length;
    for (int i = 0; i < n; i++) {
      int randomIndex = i + random.nextInt(n - i);
      
      int temp = array[i];
      array[i] = array[randomIndex];
      array[randomIndex] = temp;
    }
  } shuffle {
    Random random = new Random();
    int n = array.length;
    for (int i = 0; i < n; i++) {
      int randomIndex = i + random.nextInt(n - i);
      
      int temp = array[i];
      array[i] = array[randomIndex];
      array[randomIndex] = temp;
    }
  } Random random = new Random(); random new Random() int n = array.length; n array.length array array.length for (int i = 0; i < n; i++) {
      int randomIndex = i + random.nextInt(n - i);
      
      int temp = array[i];
      array[i] = array[randomIndex];
      array[randomIndex] = temp;
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      int randomIndex = i + random.nextInt(n - i);
      
      int temp = array[i];
      array[i] = array[randomIndex];
      array[randomIndex] = temp;
    } {
      int randomIndex = i + random.nextInt(n - i);
      
      int temp = array[i];
      array[i] = array[randomIndex];
      array[randomIndex] = temp;
    } int randomIndex = i + random.nextInt(n - i); randomIndex i + random.nextInt(n - i) i random.nextInt(n - i) random.nextInt random n - i n i int temp = array[i]; temp array[i] array i array[i] = array[randomIndex] array[i] array i array[randomIndex] array randomIndex array[randomIndex] = temp array[randomIndex] array randomIndex temp int[] array array public static void shuffle(long[] array) {
    Random random = new Random();
    int n = array.length;
    for (int i = 0; i < n; i++) {
      int randomIndex = i + random.nextInt(n - i);
      
      long temp = array[i];
      array[i] = array[randomIndex];
      array[randomIndex] = temp;
    }
  } shuffle {
    Random random = new Random();
    int n = array.length;
    for (int i = 0; i < n; i++) {
      int randomIndex = i + random.nextInt(n - i);
      
      long temp = array[i];
      array[i] = array[randomIndex];
      array[randomIndex] = temp;
    }
  } Random random = new Random(); random new Random() int n = array.length; n array.length array array.length for (int i = 0; i < n; i++) {
      int randomIndex = i + random.nextInt(n - i);
      
      long temp = array[i];
      array[i] = array[randomIndex];
      array[randomIndex] = temp;
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      int randomIndex = i + random.nextInt(n - i);
      
      long temp = array[i];
      array[i] = array[randomIndex];
      array[randomIndex] = temp;
    } {
      int randomIndex = i + random.nextInt(n - i);
      
      long temp = array[i];
      array[i] = array[randomIndex];
      array[randomIndex] = temp;
    } int randomIndex = i + random.nextInt(n - i); randomIndex i + random.nextInt(n - i) i random.nextInt(n - i) random.nextInt random n - i n i long temp = array[i]; temp array[i] array i array[i] = array[randomIndex] array[i] array i array[randomIndex] array randomIndex array[randomIndex] = temp array[randomIndex] array randomIndex temp long[] array array public static void sort(int[] array) {
    shuffle(array);
    Arrays.sort(array);
  } sort {
    shuffle(array);
    Arrays.sort(array);
  } shuffle(array) shuffle array Arrays.sort(array) Arrays.sort Arrays array int[] array array public static void sort(long[] array) {
    shuffle(array);
    Arrays.sort(array);
  } sort {
    shuffle(array);
    Arrays.sort(array);
  } shuffle(array) shuffle array Arrays.sort(array) Arrays.sort Arrays array long[] array array public class Main {
  private static boolean positive(int[] bs, int[] as, int c) {
    int sum = c;
    for (int i = 0; i < bs.length; i++) {
      sum += bs[i] * as[i];
    }
    return sum > 0;
  }
  
  private static int solve(int n, int m, int c, int[] bs, int[][] as) {
    int count = 0;
    for (int[] ai : as) {
      if (positive(bs, ai, c)) {
        count++;
      }
    }
    return count;
  }
  
  private static void execute(ContestReader reader, PrintWriter out) {
    int n = reader.nextInt();
    int m = reader.nextInt();
    int c = reader.nextInt();
    int[] bs = reader.nextIntArray(m);
    int[][] as = reader.nextIntMatrix(n, m);
    out.println(solve(n, m, c, bs, as));
  }
  
  public static void main(String[] args) {
    ContestReader reader = new ContestReader(System.in);
    PrintWriter out = new PrintWriter(System.out);
    execute(reader, out);
    out.flush();
  }
} public class Main {
  private static boolean positive(int[] bs, int[] as, int c) {
    int sum = c;
    for (int i = 0; i < bs.length; i++) {
      sum += bs[i] * as[i];
    }
    return sum > 0;
  }
  
  private static int solve(int n, int m, int c, int[] bs, int[][] as) {
    int count = 0;
    for (int[] ai : as) {
      if (positive(bs, ai, c)) {
        count++;
      }
    }
    return count;
  }
  
  private static void execute(ContestReader reader, PrintWriter out) {
    int n = reader.nextInt();
    int m = reader.nextInt();
    int c = reader.nextInt();
    int[] bs = reader.nextIntArray(m);
    int[][] as = reader.nextIntMatrix(n, m);
    out.println(solve(n, m, c, bs, as));
  }
  
  public static void main(String[] args) {
    ContestReader reader = new ContestReader(System.in);
    PrintWriter out = new PrintWriter(System.out);
    execute(reader, out);
    out.flush();
  }
} Main
import java.io.*;
import java.util.*;

public class Main {
  private static boolean positive(int[] bs, int[] as, int c) {
    int sum = c;
    for (int i = 0; i < bs.length; i++) {
      sum += bs[i] * as[i];
    }
    return sum > 0;
  }
  
  private static int solve(int n, int m, int c, int[] bs, int[][] as) {
    int count = 0;
    for (int[] ai : as) {
      if (positive(bs, ai, c)) {
        count++;
      }
    }
    return count;
  }
  
  private static void execute(ContestReader reader, PrintWriter out) {
    int n = reader.nextInt();
    int m = reader.nextInt();
    int c = reader.nextInt();
    int[] bs = reader.nextIntArray(m);
    int[][] as = reader.nextIntMatrix(n, m);
    out.println(solve(n, m, c, bs, as));
  }
  
  public static void main(String[] args) {
    ContestReader reader = new ContestReader(System.in);
    PrintWriter out = new PrintWriter(System.out);
    execute(reader, out);
    out.flush();
  }
}

class ContestReader {
  private BufferedReader reader;
  private StringTokenizer tokenizer;
  
  ContestReader(InputStream in) {
    reader = new BufferedReader(new InputStreamReader(in));
  }
  
  public String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }
  
  public int nextInt() {
    return Integer.parseInt(next());
  }
  
  public long nextLong() {
    return Long.parseLong(next());
  }
  
  public double nextDouble() {
    return Double.parseDouble(next());
  }
  
  public int[] nextIntArray(int n) {
    int[] array = new int[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextInt();
    }
    return array;
  }
  
  public long[] nextLongArray(int n) {
    long[] array = new long[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextLong();
    }
    return array;
  }
  
  public int[][] nextIntMatrix(int n, int m) {
    int[][] matrix = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    }
    return matrix;
  }
  
  public long[][] nextLongMatrix(int n, int m) {
    long[][] matrix = new long[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    }
    return matrix;
  }
}

class Algorithm {
  private static void swap(Object[] list, int a, int b) {
    Object tmp = list[a];
    list[a] = list[b];
    list[b] = tmp;
  }
  
  public static <T extends Comparable<? super T>> boolean nextPermutation(T[] ts) {
    int rightMostAscendingOrderIndex = ts.length - 2;
    while (rightMostAscendingOrderIndex >= 0 &&
        ts[rightMostAscendingOrderIndex].compareTo(ts[rightMostAscendingOrderIndex + 1]) >= 0) {
      rightMostAscendingOrderIndex--;
    }
    if (rightMostAscendingOrderIndex < 0) {
      return false;
    }
    
    int rightMostGreatorIndex = ts.length - 1;
    while (ts[rightMostAscendingOrderIndex].compareTo(ts[rightMostGreatorIndex]) >= 0) {
      rightMostGreatorIndex--;
    }
    
    swap(ts, rightMostAscendingOrderIndex, rightMostGreatorIndex);
    for (int i = 0; i < (ts.length - rightMostAscendingOrderIndex - 1) / 2; i++) {
      swap(ts, rightMostAscendingOrderIndex + 1 + i, ts.length - 1 - i);
    }
    return true;
  }
  
  public static void shuffle(int[] array) {
    Random random = new Random();
    int n = array.length;
    for (int i = 0; i < n; i++) {
      int randomIndex = i + random.nextInt(n - i);
      
      int temp = array[i];
      array[i] = array[randomIndex];
      array[randomIndex] = temp;
    }
  }
  
  public static void shuffle(long[] array) {
    Random random = new Random();
    int n = array.length;
    for (int i = 0; i < n; i++) {
      int randomIndex = i + random.nextInt(n - i);
      
      long temp = array[i];
      array[i] = array[randomIndex];
      array[randomIndex] = temp;
    }
  }
  
  public static void sort(int[] array) {
    shuffle(array);
    Arrays.sort(array);
  }
  
  public static void sort(long[] array) {
    shuffle(array);
    Arrays.sort(array);
  }
}

