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

/**
 * Hello AtCoder.
 *
 * @author kaito0228
 */
public class Main {
  public static void main(String[] args) {
    try (PrintWriter out = new PrintWriter(System.out);
        Scanner sc = new Scanner(System.in)) {
      solve(sc, out);
      out.flush();

    } catch (Exception e) {
      // DO NOT USE
      e.printStackTrace();
    }
  }

  private static void solve(Scanner sc, PrintWriter out) {
    // TODO
    int n = nint(sc);
    int m = nint(sc);
    int c = nint(sc);
    List<Integer> list = getIntegerList(sc, m);
    int ans = 0;

    for (int i = 0; i < n; i++) {
      int a = 0;
      for (int j = 0; j < m; j++) {
        a += nint(sc) * list.get(j);
      }
      if (a + c > 0) {
        ans++;
      }
    }

    out.println(ans);
  }

  // method
  /**
   * Returns an int. int値を受け取り、返します。
   *
   * @param sc Scanner
   * @return int
   */
  private static int nint(Scanner sc) {
    return Integer.parseInt(sc.next());
  }

  /**
   * Returns a long. long値を受け取り、返します。
   *
   * @param sc Scanner
   * @return long
   */
  private static long nlong(Scanner sc) {
    return Long.parseLong(sc.next());
  }

  /**
   * Returns a double. double値を受け取り、返します。
   *
   * @param sc Scanner
   * @return double
   */
  private static double ndouble(Scanner sc) {
    return Double.parseDouble(sc.next());
  }

  /**
   * Returns a String. 文字列を受け取り、返します。
   *
   * @param sc Scanner
   * @return String
   */
  private static String nstr(Scanner sc) {
    return sc.next();
  }

  /**
   * Returns a int array. int値を受け取り、配列にして返します。
   *
   * @param sc Scanner
   * @param length Array length
   * @return int array
   */
  private static int[] intLine(Scanner sc, int length) {
    int[] iLine = new int[length];
    for (int i = 0; i < length; i++) {
      iLine[i] = nint(sc);
    }
    return iLine;
  }

  /**
   * Returns a long array. long値を受け取り、配列にして返します。
   *
   * @param sc Scanner
   * @param length Array length
   * @return long array
   */
  private static long[] longLine(Scanner sc, int length) {
    long[] lLine = new long[length];
    for (int i = 0; i < length; i++) {
      lLine[i] = nlong(sc);
    }
    return lLine;
  }

  /**
   * Returns a String array. 文字列を受け取り、配列にして返します。
   *
   * @param sc Scanner
   * @param length Array length
   * @return String array
   */
  private static String[] strLine(Scanner sc, int length) {
    String[] strLine = new String[length];
    for (int i = 0; i < length; i++) {
      strLine[i] = nstr(sc);
    }
    return strLine;
  }

  /**
   * Returns the maximum value in the list. リスト内で最大値を返します。
   *
   * @param longList List
   * @return long maximum value
   */
  private static long maxFromList(List<Long> longList) {
    return longList.stream().max(Comparator.naturalOrder()).get();
  }

  /**
   * Returns the minimum value in the list. リスト内で最小値を返します。
   *
   * @param longList List
   * @return long minimum value
   */
  private static long minFromList(List<Long> longList) {
    return longList.stream().min(Comparator.naturalOrder()).get();
  }

  /**
   * Returns the sum of each digit. 各桁の和を返します。
   *
   * @param n int
   * @return sum of each digit
   */
  private static int sumDigits(int n) {
    int sum = 0;
    while (n != 0) {
      sum += n % 10;
      n /= 10;
    }
    return sum;
  }

  /**
   * Returns the sum of each digit. 各桁の和を返します。
   *
   * @param n long
   * @return sum of each digit
   */
  private static long sumDigits(long n) {
    long sum = 0;
    while (n != 0) {
      sum += n % 10;
      n /= 10;
    }
    return sum;
  }

  /**
   * Return a list of Integer. Integerのリストを返します。
   *
   * @param sc Scanner
   * @param size list size
   * @return list
   */
  private static List<Integer> getIntegerList(Scanner sc, int size) {
    List<Integer> list = new ArrayList<>();
    for (int i = 0; i < size; i++) {
      list.add(nint(sc));
    }
    return list;
  }

  /**
   * Return a list of Long. Longのリストを返します。
   *
   * @param sc Scanner
   * @param size list size
   * @return list
   */
  private static List<Long> getLongList(Scanner sc, int size) {
    List<Long> list = new ArrayList<>();
    for (int i = 0; i < size; i++) {
      list.add(nlong(sc));
    }
    return list;
  }

  /**
   * Returns the summation of list. リストの要素の合計値を返します。
   *
   * @param list List<Integer>
   * @return sum of list
   */
  private static int sumList(List<Integer> list) {
    int sum = 0;
    for (Integer n : list) {
      sum += n;
    }
    return sum;
  }

  /**
   * Returns the average of list. リストの要素の平均値を返します。
   *
   * @param list List<Integer>
   * @return average of list
   */
  private static double aveList(List<Integer> list) {
    return (double) sumList(list) / list.size();
  }

  /**
   * Returns the greatest common divisor of the two given values. 与えた2つの値の最大公約数を返します。
   *
   * @param m long
   * @param n long
   * @return greatest common divisor
   */
  private static long gcd(long m, long n) {
    if (m < n) return gcd(n, m);
    if (n == 0) return m;
    return gcd(n, m % n);
  }

  /**
   * Returns the least common multiple of the two given values. 与えた2つの値の最小公倍数を返します。
   *
   * @param m long
   * @param n long
   * @return least common multiple
   */
  private static long lcm(long m, long n) {
    return m * n / gcd(m, n);
  }

  /**
   * Returns the most frequent value in the list. リスト内で最頻出数値を返します。
   *
   * @param list List
   * @return most frequent value
   */
  private static Integer mode(List<Integer> list) {
    switch (list.size()) {
      case 0:
        throw new IllegalArgumentException();
      case 1:
        return list.get(0);
      default:
        Integer[] x = new Integer[list.size()];
        list.toArray(x);
        Arrays.sort(x);

        int maxValue = 1,
            maxKey = x[x.length - 1],
            previousKey = x[x.length - 1],
            breakPoint = x.length - 1;
        for (int i = x.length - 2; i >= 0; --i) {
          if (previousKey != x[i]) {
            if (maxValue < breakPoint - i) {
              maxValue = breakPoint - i;
              maxKey = x[i + 1];
            }
            previousKey = x[i];
            breakPoint = i;
          }
        }
        return breakPoint + 1 > maxValue ? x[0] : maxKey;
    }
  }

  private static Map<Integer, Integer> primeFactorize(long num) {
    Map<Integer, Integer> map = new HashMap<>();
    int i = 2;
    while (i * i <= num) {
      while (num % i == 0) {
        num /= i;
        if (map.containsKey(i)) {
          int tmp = map.get(i);
          tmp++;
          map.put(i, tmp);
        } else {
          map.put(i, 1);
        }
      }
      i++;
    }
    if (num > 1) map.put((int) num, 1);
    return map;
  }

  /**
   * Returns "YES" or "NO". アッパーケースのYES,NOを返します。
   *
   * @param bool boolean
   * @return "YES" or "NO"
   */
  private static String upperYESNO(boolean bool) {
    return bool ? "YES" : "NO";
  }

  /**
   * Returns "Yes" or "No". パスカルケースのYes,Noを返します。
   *
   * @param bool boolean
   * @return "Yes" or "No"
   */
  private static String pascalYesNo(boolean bool) {
    return bool ? "Yes" : "No";
  }
} import java.io.PrintWriter; PrintWriter java.io import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    try (PrintWriter out = new PrintWriter(System.out);
        Scanner sc = new Scanner(System.in)) {
      solve(sc, out);
      out.flush();

    } catch (Exception e) {
      // DO NOT USE
      e.printStackTrace();
    }
  }

  private static void solve(Scanner sc, PrintWriter out) {
    // TODO
    int n = nint(sc);
    int m = nint(sc);
    int c = nint(sc);
    List<Integer> list = getIntegerList(sc, m);
    int ans = 0;

    for (int i = 0; i < n; i++) {
      int a = 0;
      for (int j = 0; j < m; j++) {
        a += nint(sc) * list.get(j);
      }
      if (a + c > 0) {
        ans++;
      }
    }

    out.println(ans);
  }

  // method
  /**
   * Returns an int. int値を受け取り、返します。
   *
   * @param sc Scanner
   * @return int
   */
  private static int nint(Scanner sc) {
    return Integer.parseInt(sc.next());
  }

  /**
   * Returns a long. long値を受け取り、返します。
   *
   * @param sc Scanner
   * @return long
   */
  private static long nlong(Scanner sc) {
    return Long.parseLong(sc.next());
  }

  /**
   * Returns a double. double値を受け取り、返します。
   *
   * @param sc Scanner
   * @return double
   */
  private static double ndouble(Scanner sc) {
    return Double.parseDouble(sc.next());
  }

  /**
   * Returns a String. 文字列を受け取り、返します。
   *
   * @param sc Scanner
   * @return String
   */
  private static String nstr(Scanner sc) {
    return sc.next();
  }

  /**
   * Returns a int array. int値を受け取り、配列にして返します。
   *
   * @param sc Scanner
   * @param length Array length
   * @return int array
   */
  private static int[] intLine(Scanner sc, int length) {
    int[] iLine = new int[length];
    for (int i = 0; i < length; i++) {
      iLine[i] = nint(sc);
    }
    return iLine;
  }

  /**
   * Returns a long array. long値を受け取り、配列にして返します。
   *
   * @param sc Scanner
   * @param length Array length
   * @return long array
   */
  private static long[] longLine(Scanner sc, int length) {
    long[] lLine = new long[length];
    for (int i = 0; i < length; i++) {
      lLine[i] = nlong(sc);
    }
    return lLine;
  }

  /**
   * Returns a String array. 文字列を受け取り、配列にして返します。
   *
   * @param sc Scanner
   * @param length Array length
   * @return String array
   */
  private static String[] strLine(Scanner sc, int length) {
    String[] strLine = new String[length];
    for (int i = 0; i < length; i++) {
      strLine[i] = nstr(sc);
    }
    return strLine;
  }

  /**
   * Returns the maximum value in the list. リスト内で最大値を返します。
   *
   * @param longList List
   * @return long maximum value
   */
  private static long maxFromList(List<Long> longList) {
    return longList.stream().max(Comparator.naturalOrder()).get();
  }

  /**
   * Returns the minimum value in the list. リスト内で最小値を返します。
   *
   * @param longList List
   * @return long minimum value
   */
  private static long minFromList(List<Long> longList) {
    return longList.stream().min(Comparator.naturalOrder()).get();
  }

  /**
   * Returns the sum of each digit. 各桁の和を返します。
   *
   * @param n int
   * @return sum of each digit
   */
  private static int sumDigits(int n) {
    int sum = 0;
    while (n != 0) {
      sum += n % 10;
      n /= 10;
    }
    return sum;
  }

  /**
   * Returns the sum of each digit. 各桁の和を返します。
   *
   * @param n long
   * @return sum of each digit
   */
  private static long sumDigits(long n) {
    long sum = 0;
    while (n != 0) {
      sum += n % 10;
      n /= 10;
    }
    return sum;
  }

  /**
   * Return a list of Integer. Integerのリストを返します。
   *
   * @param sc Scanner
   * @param size list size
   * @return list
   */
  private static List<Integer> getIntegerList(Scanner sc, int size) {
    List<Integer> list = new ArrayList<>();
    for (int i = 0; i < size; i++) {
      list.add(nint(sc));
    }
    return list;
  }

  /**
   * Return a list of Long. Longのリストを返します。
   *
   * @param sc Scanner
   * @param size list size
   * @return list
   */
  private static List<Long> getLongList(Scanner sc, int size) {
    List<Long> list = new ArrayList<>();
    for (int i = 0; i < size; i++) {
      list.add(nlong(sc));
    }
    return list;
  }

  /**
   * Returns the summation of list. リストの要素の合計値を返します。
   *
   * @param list List<Integer>
   * @return sum of list
   */
  private static int sumList(List<Integer> list) {
    int sum = 0;
    for (Integer n : list) {
      sum += n;
    }
    return sum;
  }

  /**
   * Returns the average of list. リストの要素の平均値を返します。
   *
   * @param list List<Integer>
   * @return average of list
   */
  private static double aveList(List<Integer> list) {
    return (double) sumList(list) / list.size();
  }

  /**
   * Returns the greatest common divisor of the two given values. 与えた2つの値の最大公約数を返します。
   *
   * @param m long
   * @param n long
   * @return greatest common divisor
   */
  private static long gcd(long m, long n) {
    if (m < n) return gcd(n, m);
    if (n == 0) return m;
    return gcd(n, m % n);
  }

  /**
   * Returns the least common multiple of the two given values. 与えた2つの値の最小公倍数を返します。
   *
   * @param m long
   * @param n long
   * @return least common multiple
   */
  private static long lcm(long m, long n) {
    return m * n / gcd(m, n);
  }

  /**
   * Returns the most frequent value in the list. リスト内で最頻出数値を返します。
   *
   * @param list List
   * @return most frequent value
   */
  private static Integer mode(List<Integer> list) {
    switch (list.size()) {
      case 0:
        throw new IllegalArgumentException();
      case 1:
        return list.get(0);
      default:
        Integer[] x = new Integer[list.size()];
        list.toArray(x);
        Arrays.sort(x);

        int maxValue = 1,
            maxKey = x[x.length - 1],
            previousKey = x[x.length - 1],
            breakPoint = x.length - 1;
        for (int i = x.length - 2; i >= 0; --i) {
          if (previousKey != x[i]) {
            if (maxValue < breakPoint - i) {
              maxValue = breakPoint - i;
              maxKey = x[i + 1];
            }
            previousKey = x[i];
            breakPoint = i;
          }
        }
        return breakPoint + 1 > maxValue ? x[0] : maxKey;
    }
  }

  private static Map<Integer, Integer> primeFactorize(long num) {
    Map<Integer, Integer> map = new HashMap<>();
    int i = 2;
    while (i * i <= num) {
      while (num % i == 0) {
        num /= i;
        if (map.containsKey(i)) {
          int tmp = map.get(i);
          tmp++;
          map.put(i, tmp);
        } else {
          map.put(i, 1);
        }
      }
      i++;
    }
    if (num > 1) map.put((int) num, 1);
    return map;
  }

  /**
   * Returns "YES" or "NO". アッパーケースのYES,NOを返します。
   *
   * @param bool boolean
   * @return "YES" or "NO"
   */
  private static String upperYESNO(boolean bool) {
    return bool ? "YES" : "NO";
  }

  /**
   * Returns "Yes" or "No". パスカルケースのYes,Noを返します。
   *
   * @param bool boolean
   * @return "Yes" or "No"
   */
  private static String pascalYesNo(boolean bool) {
    return bool ? "Yes" : "No";
  }
} Main public static void main(String[] args) {
    try (PrintWriter out = new PrintWriter(System.out);
        Scanner sc = new Scanner(System.in)) {
      solve(sc, out);
      out.flush();

    } catch (Exception e) {
      // DO NOT USE
      e.printStackTrace();
    }
  } main {
    try (PrintWriter out = new PrintWriter(System.out);
        Scanner sc = new Scanner(System.in)) {
      solve(sc, out);
      out.flush();

    } catch (Exception e) {
      // DO NOT USE
      e.printStackTrace();
    }
  } try (PrintWriter out = new PrintWriter(System.out);
        Scanner sc = new Scanner(System.in)) {
      solve(sc, out);
      out.flush();

    } catch (Exception e) {
      // DO NOT USE
      e.printStackTrace();
    } catch (Exception e) {
      // DO NOT USE
      e.printStackTrace();
    } Exception e {
      // DO NOT USE
      e.printStackTrace();
    } e.printStackTrace() e.printStackTrace e {
      solve(sc, out);
      out.flush();

    } PrintWriter out = new PrintWriter(System.out) PrintWriter out = new PrintWriter(System.out) new PrintWriter(System.out) Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) solve(sc, out) solve sc out out.flush() out.flush out String[] args args private static void solve(Scanner sc, PrintWriter out) {
    // TODO
    int n = nint(sc);
    int m = nint(sc);
    int c = nint(sc);
    List<Integer> list = getIntegerList(sc, m);
    int ans = 0;

    for (int i = 0; i < n; i++) {
      int a = 0;
      for (int j = 0; j < m; j++) {
        a += nint(sc) * list.get(j);
      }
      if (a + c > 0) {
        ans++;
      }
    }

    out.println(ans);
  } solve {
    // TODO
    int n = nint(sc);
    int m = nint(sc);
    int c = nint(sc);
    List<Integer> list = getIntegerList(sc, m);
    int ans = 0;

    for (int i = 0; i < n; i++) {
      int a = 0;
      for (int j = 0; j < m; j++) {
        a += nint(sc) * list.get(j);
      }
      if (a + c > 0) {
        ans++;
      }
    }

    out.println(ans);
  } int n = nint(sc); n nint(sc) nint sc int m = nint(sc); m nint(sc) nint sc int c = nint(sc); c nint(sc) nint sc List<Integer> list = getIntegerList(sc, m); list getIntegerList(sc, m) getIntegerList sc m int ans = 0; ans 0 for (int i = 0; i < n; i++) {
      int a = 0;
      for (int j = 0; j < m; j++) {
        a += nint(sc) * list.get(j);
      }
      if (a + c > 0) {
        ans++;
      }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      int a = 0;
      for (int j = 0; j < m; j++) {
        a += nint(sc) * list.get(j);
      }
      if (a + c > 0) {
        ans++;
      }
    } {
      int a = 0;
      for (int j = 0; j < m; j++) {
        a += nint(sc) * list.get(j);
      }
      if (a + c > 0) {
        ans++;
      }
    } int a = 0; a 0 for (int j = 0; j < m; j++) {
        a += nint(sc) * list.get(j);
      } int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
        a += nint(sc) * list.get(j);
      } {
        a += nint(sc) * list.get(j);
      } a += nint(sc) * list.get(j) a nint(sc) * list.get(j) nint(sc) nint sc list.get(j) list.get list j if (a + c > 0) {
        ans++;
      } a + c > 0 a + c a c 0 {
        ans++;
      } ans++ ans out.println(ans) out.println out ans Scanner sc sc PrintWriter out out /**
   * Returns an int. int値を受け取り、返します。
   *
   * @param sc Scanner
   * @return int
   */
  private static int nint(Scanner sc) {
    return Integer.parseInt(sc.next());
  } nint {
    return Integer.parseInt(sc.next());
  } return Integer.parseInt(sc.next()); Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc Scanner sc sc /**
   * Returns a long. long値を受け取り、返します。
   *
   * @param sc Scanner
   * @return long
   */
  private static long nlong(Scanner sc) {
    return Long.parseLong(sc.next());
  } nlong {
    return Long.parseLong(sc.next());
  } return Long.parseLong(sc.next()); Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc Scanner sc sc /**
   * Returns a double. double値を受け取り、返します。
   *
   * @param sc Scanner
   * @return double
   */
  private static double ndouble(Scanner sc) {
    return Double.parseDouble(sc.next());
  } ndouble {
    return Double.parseDouble(sc.next());
  } return Double.parseDouble(sc.next()); Double.parseDouble(sc.next()) Double.parseDouble Double sc.next() sc.next sc Scanner sc sc /**
   * Returns a String. 文字列を受け取り、返します。
   *
   * @param sc Scanner
   * @return String
   */
  private static String nstr(Scanner sc) {
    return sc.next();
  } nstr {
    return sc.next();
  } return sc.next(); sc.next() sc.next sc Scanner sc sc /**
   * Returns a int array. int値を受け取り、配列にして返します。
   *
   * @param sc Scanner
   * @param length Array length
   * @return int array
   */
  private static int[] intLine(Scanner sc, int length) {
    int[] iLine = new int[length];
    for (int i = 0; i < length; i++) {
      iLine[i] = nint(sc);
    }
    return iLine;
  } intLine {
    int[] iLine = new int[length];
    for (int i = 0; i < length; i++) {
      iLine[i] = nint(sc);
    }
    return iLine;
  } int[] iLine = new int[length]; iLine new int[length] length for (int i = 0; i < length; i++) {
      iLine[i] = nint(sc);
    } int i = 0; int i = 0; i 0 i < length i length i++ i++ i {
      iLine[i] = nint(sc);
    } {
      iLine[i] = nint(sc);
    } iLine[i] = nint(sc) iLine[i] iLine i nint(sc) nint sc return iLine; iLine Scanner sc sc int length length /**
   * Returns a long array. long値を受け取り、配列にして返します。
   *
   * @param sc Scanner
   * @param length Array length
   * @return long array
   */
  private static long[] longLine(Scanner sc, int length) {
    long[] lLine = new long[length];
    for (int i = 0; i < length; i++) {
      lLine[i] = nlong(sc);
    }
    return lLine;
  } longLine {
    long[] lLine = new long[length];
    for (int i = 0; i < length; i++) {
      lLine[i] = nlong(sc);
    }
    return lLine;
  } long[] lLine = new long[length]; lLine new long[length] length for (int i = 0; i < length; i++) {
      lLine[i] = nlong(sc);
    } int i = 0; int i = 0; i 0 i < length i length i++ i++ i {
      lLine[i] = nlong(sc);
    } {
      lLine[i] = nlong(sc);
    } lLine[i] = nlong(sc) lLine[i] lLine i nlong(sc) nlong sc return lLine; lLine Scanner sc sc int length length /**
   * Returns a String array. 文字列を受け取り、配列にして返します。
   *
   * @param sc Scanner
   * @param length Array length
   * @return String array
   */
  private static String[] strLine(Scanner sc, int length) {
    String[] strLine = new String[length];
    for (int i = 0; i < length; i++) {
      strLine[i] = nstr(sc);
    }
    return strLine;
  } strLine {
    String[] strLine = new String[length];
    for (int i = 0; i < length; i++) {
      strLine[i] = nstr(sc);
    }
    return strLine;
  } String[] strLine = new String[length]; strLine new String[length] length for (int i = 0; i < length; i++) {
      strLine[i] = nstr(sc);
    } int i = 0; int i = 0; i 0 i < length i length i++ i++ i {
      strLine[i] = nstr(sc);
    } {
      strLine[i] = nstr(sc);
    } strLine[i] = nstr(sc) strLine[i] strLine i nstr(sc) nstr sc return strLine; strLine Scanner sc sc int length length /**
   * Returns the maximum value in the list. リスト内で最大値を返します。
   *
   * @param longList List
   * @return long maximum value
   */
  private static long maxFromList(List<Long> longList) {
    return longList.stream().max(Comparator.naturalOrder()).get();
  } maxFromList {
    return longList.stream().max(Comparator.naturalOrder()).get();
  } return longList.stream().max(Comparator.naturalOrder()).get(); longList.stream().max(Comparator.naturalOrder()).get() longList.stream().max(Comparator.naturalOrder()).get longList.stream().max(Comparator.naturalOrder()) longList.stream().max longList.stream() longList.stream longList Comparator.naturalOrder() Comparator.naturalOrder Comparator List<Long> longList longList /**
   * Returns the minimum value in the list. リスト内で最小値を返します。
   *
   * @param longList List
   * @return long minimum value
   */
  private static long minFromList(List<Long> longList) {
    return longList.stream().min(Comparator.naturalOrder()).get();
  } minFromList {
    return longList.stream().min(Comparator.naturalOrder()).get();
  } return longList.stream().min(Comparator.naturalOrder()).get(); longList.stream().min(Comparator.naturalOrder()).get() longList.stream().min(Comparator.naturalOrder()).get longList.stream().min(Comparator.naturalOrder()) longList.stream().min longList.stream() longList.stream longList Comparator.naturalOrder() Comparator.naturalOrder Comparator List<Long> longList longList /**
   * Returns the sum of each digit. 各桁の和を返します。
   *
   * @param n int
   * @return sum of each digit
   */
  private static int sumDigits(int n) {
    int sum = 0;
    while (n != 0) {
      sum += n % 10;
      n /= 10;
    }
    return sum;
  } sumDigits {
    int sum = 0;
    while (n != 0) {
      sum += n % 10;
      n /= 10;
    }
    return sum;
  } int sum = 0; sum 0 while (n != 0) {
      sum += n % 10;
      n /= 10;
    } n != 0 n 0 {
      sum += n % 10;
      n /= 10;
    } sum += n % 10 sum n % 10 n 10 n /= 10 n 10 return sum; sum int n n /**
   * Returns the sum of each digit. 各桁の和を返します。
   *
   * @param n long
   * @return sum of each digit
   */
  private static long sumDigits(long n) {
    long sum = 0;
    while (n != 0) {
      sum += n % 10;
      n /= 10;
    }
    return sum;
  } sumDigits {
    long sum = 0;
    while (n != 0) {
      sum += n % 10;
      n /= 10;
    }
    return sum;
  } long sum = 0; sum 0 while (n != 0) {
      sum += n % 10;
      n /= 10;
    } n != 0 n 0 {
      sum += n % 10;
      n /= 10;
    } sum += n % 10 sum n % 10 n 10 n /= 10 n 10 return sum; sum long n n /**
   * Return a list of Integer. Integerのリストを返します。
   *
   * @param sc Scanner
   * @param size list size
   * @return list
   */
  private static List<Integer> getIntegerList(Scanner sc, int size) {
    List<Integer> list = new ArrayList<>();
    for (int i = 0; i < size; i++) {
      list.add(nint(sc));
    }
    return list;
  } getIntegerList {
    List<Integer> list = new ArrayList<>();
    for (int i = 0; i < size; i++) {
      list.add(nint(sc));
    }
    return list;
  } List<Integer> list = new ArrayList<>(); list new ArrayList<>() for (int i = 0; i < size; i++) {
      list.add(nint(sc));
    } int i = 0; int i = 0; i 0 i < size i size i++ i++ i {
      list.add(nint(sc));
    } {
      list.add(nint(sc));
    } list.add(nint(sc)) list.add list nint(sc) nint sc return list; list Scanner sc sc int size size /**
   * Return a list of Long. Longのリストを返します。
   *
   * @param sc Scanner
   * @param size list size
   * @return list
   */
  private static List<Long> getLongList(Scanner sc, int size) {
    List<Long> list = new ArrayList<>();
    for (int i = 0; i < size; i++) {
      list.add(nlong(sc));
    }
    return list;
  } getLongList {
    List<Long> list = new ArrayList<>();
    for (int i = 0; i < size; i++) {
      list.add(nlong(sc));
    }
    return list;
  } List<Long> list = new ArrayList<>(); list new ArrayList<>() for (int i = 0; i < size; i++) {
      list.add(nlong(sc));
    } int i = 0; int i = 0; i 0 i < size i size i++ i++ i {
      list.add(nlong(sc));
    } {
      list.add(nlong(sc));
    } list.add(nlong(sc)) list.add list nlong(sc) nlong sc return list; list Scanner sc sc int size size /**
   * Returns the summation of list. リストの要素の合計値を返します。
   *
   * @param list List<Integer>
   * @return sum of list
   */
  private static int sumList(List<Integer> list) {
    int sum = 0;
    for (Integer n : list) {
      sum += n;
    }
    return sum;
  } sumList {
    int sum = 0;
    for (Integer n : list) {
      sum += n;
    }
    return sum;
  } int sum = 0; sum 0 for (Integer n : list) {
      sum += n;
    } Integer n list {
      sum += n;
    } {
      sum += n;
    } sum += n sum n return sum; sum List<Integer> list list /**
   * Returns the average of list. リストの要素の平均値を返します。
   *
   * @param list List<Integer>
   * @return average of list
   */
  private static double aveList(List<Integer> list) {
    return (double) sumList(list) / list.size();
  } aveList {
    return (double) sumList(list) / list.size();
  } return (double) sumList(list) / list.size(); (double) sumList(list) / list.size() (double) sumList(list) sumList list list.size() list.size list List<Integer> list list /**
   * Returns the greatest common divisor of the two given values. 与えた2つの値の最大公約数を返します。
   *
   * @param m long
   * @param n long
   * @return greatest common divisor
   */
  private static long gcd(long m, long n) {
    if (m < n) return gcd(n, m);
    if (n == 0) return m;
    return gcd(n, m % n);
  } gcd {
    if (m < n) return gcd(n, m);
    if (n == 0) return m;
    return gcd(n, m % n);
  } if (m < n) return gcd(n, m); m < n m n return gcd(n, m); gcd(n, m) gcd n m if (n == 0) return m; n == 0 n 0 return m; m return gcd(n, m % n); gcd(n, m % n) gcd n m % n m n long m m long n n /**
   * Returns the least common multiple of the two given values. 与えた2つの値の最小公倍数を返します。
   *
   * @param m long
   * @param n long
   * @return least common multiple
   */
  private static long lcm(long m, long n) {
    return m * n / gcd(m, n);
  } lcm {
    return m * n / gcd(m, n);
  } return m * n / gcd(m, n); m * n / gcd(m, n) m * n m n gcd(m, n) gcd m n long m m long n n /**
   * Returns the most frequent value in the list. リスト内で最頻出数値を返します。
   *
   * @param list List
   * @return most frequent value
   */
  private static Integer mode(List<Integer> list) {
    switch (list.size()) {
      case 0:
        throw new IllegalArgumentException();
      case 1:
        return list.get(0);
      default:
        Integer[] x = new Integer[list.size()];
        list.toArray(x);
        Arrays.sort(x);

        int maxValue = 1,
            maxKey = x[x.length - 1],
            previousKey = x[x.length - 1],
            breakPoint = x.length - 1;
        for (int i = x.length - 2; i >= 0; --i) {
          if (previousKey != x[i]) {
            if (maxValue < breakPoint - i) {
              maxValue = breakPoint - i;
              maxKey = x[i + 1];
            }
            previousKey = x[i];
            breakPoint = i;
          }
        }
        return breakPoint + 1 > maxValue ? x[0] : maxKey;
    }
  } mode {
    switch (list.size()) {
      case 0:
        throw new IllegalArgumentException();
      case 1:
        return list.get(0);
      default:
        Integer[] x = new Integer[list.size()];
        list.toArray(x);
        Arrays.sort(x);

        int maxValue = 1,
            maxKey = x[x.length - 1],
            previousKey = x[x.length - 1],
            breakPoint = x.length - 1;
        for (int i = x.length - 2; i >= 0; --i) {
          if (previousKey != x[i]) {
            if (maxValue < breakPoint - i) {
              maxValue = breakPoint - i;
              maxKey = x[i + 1];
            }
            previousKey = x[i];
            breakPoint = i;
          }
        }
        return breakPoint + 1 > maxValue ? x[0] : maxKey;
    }
  } switch (list.size()) {
      case 0:
        throw new IllegalArgumentException();
      case 1:
        return list.get(0);
      default:
        Integer[] x = new Integer[list.size()];
        list.toArray(x);
        Arrays.sort(x);

        int maxValue = 1,
            maxKey = x[x.length - 1],
            previousKey = x[x.length - 1],
            breakPoint = x.length - 1;
        for (int i = x.length - 2; i >= 0; --i) {
          if (previousKey != x[i]) {
            if (maxValue < breakPoint - i) {
              maxValue = breakPoint - i;
              maxKey = x[i + 1];
            }
            previousKey = x[i];
            breakPoint = i;
          }
        }
        return breakPoint + 1 > maxValue ? x[0] : maxKey;
    } list.size() list.size list case 0: 0 case 0: throw new IllegalArgumentException(); new IllegalArgumentException() case 1: 1 case 1: return list.get(0); list.get(0) list.get list 0 default: default: Integer[] x = new Integer[list.size()]; x new Integer[list.size()] list.size() list.size list list.toArray(x) list.toArray list x Arrays.sort(x) Arrays.sort Arrays x int maxValue = 1 maxValue 1 maxKey = x[x.length - 1] maxKey x[x.length - 1] x x.length - 1 x.length x x.length 1 previousKey = x[x.length - 1] previousKey x[x.length - 1] x x.length - 1 x.length x x.length 1 breakPoint = x.length - 1; breakPoint x.length - 1 x.length x x.length 1 for (int i = x.length - 2; i >= 0; --i) {
          if (previousKey != x[i]) {
            if (maxValue < breakPoint - i) {
              maxValue = breakPoint - i;
              maxKey = x[i + 1];
            }
            previousKey = x[i];
            breakPoint = i;
          }
        } int i = x.length - 2; int i = x.length - 2; i x.length - 2 x.length x x.length 2 i >= 0 i 0 --i --i i {
          if (previousKey != x[i]) {
            if (maxValue < breakPoint - i) {
              maxValue = breakPoint - i;
              maxKey = x[i + 1];
            }
            previousKey = x[i];
            breakPoint = i;
          }
        } {
          if (previousKey != x[i]) {
            if (maxValue < breakPoint - i) {
              maxValue = breakPoint - i;
              maxKey = x[i + 1];
            }
            previousKey = x[i];
            breakPoint = i;
          }
        } if (previousKey != x[i]) {
            if (maxValue < breakPoint - i) {
              maxValue = breakPoint - i;
              maxKey = x[i + 1];
            }
            previousKey = x[i];
            breakPoint = i;
          } previousKey != x[i] previousKey x[i] x i {
            if (maxValue < breakPoint - i) {
              maxValue = breakPoint - i;
              maxKey = x[i + 1];
            }
            previousKey = x[i];
            breakPoint = i;
          } if (maxValue < breakPoint - i) {
              maxValue = breakPoint - i;
              maxKey = x[i + 1];
            } maxValue < breakPoint - i maxValue breakPoint - i breakPoint i {
              maxValue = breakPoint - i;
              maxKey = x[i + 1];
            } maxValue = breakPoint - i maxValue breakPoint - i breakPoint i maxKey = x[i + 1] maxKey x[i + 1] x i + 1 i 1 previousKey = x[i] previousKey x[i] x i breakPoint = i breakPoint i return breakPoint + 1 > maxValue ? x[0] : maxKey; breakPoint + 1 > maxValue ? x[0] : maxKey breakPoint + 1 > maxValue breakPoint + 1 breakPoint 1 maxValue x[0] x 0 maxKey List<Integer> list list private static Map<Integer, Integer> primeFactorize(long num) {
    Map<Integer, Integer> map = new HashMap<>();
    int i = 2;
    while (i * i <= num) {
      while (num % i == 0) {
        num /= i;
        if (map.containsKey(i)) {
          int tmp = map.get(i);
          tmp++;
          map.put(i, tmp);
        } else {
          map.put(i, 1);
        }
      }
      i++;
    }
    if (num > 1) map.put((int) num, 1);
    return map;
  } primeFactorize {
    Map<Integer, Integer> map = new HashMap<>();
    int i = 2;
    while (i * i <= num) {
      while (num % i == 0) {
        num /= i;
        if (map.containsKey(i)) {
          int tmp = map.get(i);
          tmp++;
          map.put(i, tmp);
        } else {
          map.put(i, 1);
        }
      }
      i++;
    }
    if (num > 1) map.put((int) num, 1);
    return map;
  } Map<Integer, Integer> map = new HashMap<>(); map new HashMap<>() int i = 2; i 2 while (i * i <= num) {
      while (num % i == 0) {
        num /= i;
        if (map.containsKey(i)) {
          int tmp = map.get(i);
          tmp++;
          map.put(i, tmp);
        } else {
          map.put(i, 1);
        }
      }
      i++;
    } i * i <= num i * i i i num {
      while (num % i == 0) {
        num /= i;
        if (map.containsKey(i)) {
          int tmp = map.get(i);
          tmp++;
          map.put(i, tmp);
        } else {
          map.put(i, 1);
        }
      }
      i++;
    } while (num % i == 0) {
        num /= i;
        if (map.containsKey(i)) {
          int tmp = map.get(i);
          tmp++;
          map.put(i, tmp);
        } else {
          map.put(i, 1);
        }
      } num % i == 0 num % i num i 0 {
        num /= i;
        if (map.containsKey(i)) {
          int tmp = map.get(i);
          tmp++;
          map.put(i, tmp);
        } else {
          map.put(i, 1);
        }
      } num /= i num i if (map.containsKey(i)) {
          int tmp = map.get(i);
          tmp++;
          map.put(i, tmp);
        } else {
          map.put(i, 1);
        } map.containsKey(i) map.containsKey map i {
          int tmp = map.get(i);
          tmp++;
          map.put(i, tmp);
        } int tmp = map.get(i); tmp map.get(i) map.get map i tmp++ tmp map.put(i, tmp) map.put map i tmp {
          map.put(i, 1);
        } map.put(i, 1) map.put map i 1 i++ i if (num > 1) map.put((int) num, 1); num > 1 num 1 map.put((int) num, 1) map.put map (int) num 1 return map; map long num num /**
   * Returns "YES" or "NO". アッパーケースのYES,NOを返します。
   *
   * @param bool boolean
   * @return "YES" or "NO"
   */
  private static String upperYESNO(boolean bool) {
    return bool ? "YES" : "NO";
  } upperYESNO {
    return bool ? "YES" : "NO";
  } return bool ? "YES" : "NO"; bool ? "YES" : "NO" bool "YES" "NO" boolean bool bool /**
   * Returns "Yes" or "No". パスカルケースのYes,Noを返します。
   *
   * @param bool boolean
   * @return "Yes" or "No"
   */
  private static String pascalYesNo(boolean bool) {
    return bool ? "Yes" : "No";
  } pascalYesNo {
    return bool ? "Yes" : "No";
  } return bool ? "Yes" : "No"; bool ? "Yes" : "No" bool "Yes" "No" boolean bool bool public class Main {
  public static void main(String[] args) {
    try (PrintWriter out = new PrintWriter(System.out);
        Scanner sc = new Scanner(System.in)) {
      solve(sc, out);
      out.flush();

    } catch (Exception e) {
      // DO NOT USE
      e.printStackTrace();
    }
  }

  private static void solve(Scanner sc, PrintWriter out) {
    // TODO
    int n = nint(sc);
    int m = nint(sc);
    int c = nint(sc);
    List<Integer> list = getIntegerList(sc, m);
    int ans = 0;

    for (int i = 0; i < n; i++) {
      int a = 0;
      for (int j = 0; j < m; j++) {
        a += nint(sc) * list.get(j);
      }
      if (a + c > 0) {
        ans++;
      }
    }

    out.println(ans);
  }

  // method
  /**
   * Returns an int. int値を受け取り、返します。
   *
   * @param sc Scanner
   * @return int
   */
  private static int nint(Scanner sc) {
    return Integer.parseInt(sc.next());
  }

  /**
   * Returns a long. long値を受け取り、返します。
   *
   * @param sc Scanner
   * @return long
   */
  private static long nlong(Scanner sc) {
    return Long.parseLong(sc.next());
  }

  /**
   * Returns a double. double値を受け取り、返します。
   *
   * @param sc Scanner
   * @return double
   */
  private static double ndouble(Scanner sc) {
    return Double.parseDouble(sc.next());
  }

  /**
   * Returns a String. 文字列を受け取り、返します。
   *
   * @param sc Scanner
   * @return String
   */
  private static String nstr(Scanner sc) {
    return sc.next();
  }

  /**
   * Returns a int array. int値を受け取り、配列にして返します。
   *
   * @param sc Scanner
   * @param length Array length
   * @return int array
   */
  private static int[] intLine(Scanner sc, int length) {
    int[] iLine = new int[length];
    for (int i = 0; i < length; i++) {
      iLine[i] = nint(sc);
    }
    return iLine;
  }

  /**
   * Returns a long array. long値を受け取り、配列にして返します。
   *
   * @param sc Scanner
   * @param length Array length
   * @return long array
   */
  private static long[] longLine(Scanner sc, int length) {
    long[] lLine = new long[length];
    for (int i = 0; i < length; i++) {
      lLine[i] = nlong(sc);
    }
    return lLine;
  }

  /**
   * Returns a String array. 文字列を受け取り、配列にして返します。
   *
   * @param sc Scanner
   * @param length Array length
   * @return String array
   */
  private static String[] strLine(Scanner sc, int length) {
    String[] strLine = new String[length];
    for (int i = 0; i < length; i++) {
      strLine[i] = nstr(sc);
    }
    return strLine;
  }

  /**
   * Returns the maximum value in the list. リスト内で最大値を返します。
   *
   * @param longList List
   * @return long maximum value
   */
  private static long maxFromList(List<Long> longList) {
    return longList.stream().max(Comparator.naturalOrder()).get();
  }

  /**
   * Returns the minimum value in the list. リスト内で最小値を返します。
   *
   * @param longList List
   * @return long minimum value
   */
  private static long minFromList(List<Long> longList) {
    return longList.stream().min(Comparator.naturalOrder()).get();
  }

  /**
   * Returns the sum of each digit. 各桁の和を返します。
   *
   * @param n int
   * @return sum of each digit
   */
  private static int sumDigits(int n) {
    int sum = 0;
    while (n != 0) {
      sum += n % 10;
      n /= 10;
    }
    return sum;
  }

  /**
   * Returns the sum of each digit. 各桁の和を返します。
   *
   * @param n long
   * @return sum of each digit
   */
  private static long sumDigits(long n) {
    long sum = 0;
    while (n != 0) {
      sum += n % 10;
      n /= 10;
    }
    return sum;
  }

  /**
   * Return a list of Integer. Integerのリストを返します。
   *
   * @param sc Scanner
   * @param size list size
   * @return list
   */
  private static List<Integer> getIntegerList(Scanner sc, int size) {
    List<Integer> list = new ArrayList<>();
    for (int i = 0; i < size; i++) {
      list.add(nint(sc));
    }
    return list;
  }

  /**
   * Return a list of Long. Longのリストを返します。
   *
   * @param sc Scanner
   * @param size list size
   * @return list
   */
  private static List<Long> getLongList(Scanner sc, int size) {
    List<Long> list = new ArrayList<>();
    for (int i = 0; i < size; i++) {
      list.add(nlong(sc));
    }
    return list;
  }

  /**
   * Returns the summation of list. リストの要素の合計値を返します。
   *
   * @param list List<Integer>
   * @return sum of list
   */
  private static int sumList(List<Integer> list) {
    int sum = 0;
    for (Integer n : list) {
      sum += n;
    }
    return sum;
  }

  /**
   * Returns the average of list. リストの要素の平均値を返します。
   *
   * @param list List<Integer>
   * @return average of list
   */
  private static double aveList(List<Integer> list) {
    return (double) sumList(list) / list.size();
  }

  /**
   * Returns the greatest common divisor of the two given values. 与えた2つの値の最大公約数を返します。
   *
   * @param m long
   * @param n long
   * @return greatest common divisor
   */
  private static long gcd(long m, long n) {
    if (m < n) return gcd(n, m);
    if (n == 0) return m;
    return gcd(n, m % n);
  }

  /**
   * Returns the least common multiple of the two given values. 与えた2つの値の最小公倍数を返します。
   *
   * @param m long
   * @param n long
   * @return least common multiple
   */
  private static long lcm(long m, long n) {
    return m * n / gcd(m, n);
  }

  /**
   * Returns the most frequent value in the list. リスト内で最頻出数値を返します。
   *
   * @param list List
   * @return most frequent value
   */
  private static Integer mode(List<Integer> list) {
    switch (list.size()) {
      case 0:
        throw new IllegalArgumentException();
      case 1:
        return list.get(0);
      default:
        Integer[] x = new Integer[list.size()];
        list.toArray(x);
        Arrays.sort(x);

        int maxValue = 1,
            maxKey = x[x.length - 1],
            previousKey = x[x.length - 1],
            breakPoint = x.length - 1;
        for (int i = x.length - 2; i >= 0; --i) {
          if (previousKey != x[i]) {
            if (maxValue < breakPoint - i) {
              maxValue = breakPoint - i;
              maxKey = x[i + 1];
            }
            previousKey = x[i];
            breakPoint = i;
          }
        }
        return breakPoint + 1 > maxValue ? x[0] : maxKey;
    }
  }

  private static Map<Integer, Integer> primeFactorize(long num) {
    Map<Integer, Integer> map = new HashMap<>();
    int i = 2;
    while (i * i <= num) {
      while (num % i == 0) {
        num /= i;
        if (map.containsKey(i)) {
          int tmp = map.get(i);
          tmp++;
          map.put(i, tmp);
        } else {
          map.put(i, 1);
        }
      }
      i++;
    }
    if (num > 1) map.put((int) num, 1);
    return map;
  }

  /**
   * Returns "YES" or "NO". アッパーケースのYES,NOを返します。
   *
   * @param bool boolean
   * @return "YES" or "NO"
   */
  private static String upperYESNO(boolean bool) {
    return bool ? "YES" : "NO";
  }

  /**
   * Returns "Yes" or "No". パスカルケースのYes,Noを返します。
   *
   * @param bool boolean
   * @return "Yes" or "No"
   */
  private static String pascalYesNo(boolean bool) {
    return bool ? "Yes" : "No";
  }
} public class Main {
  public static void main(String[] args) {
    try (PrintWriter out = new PrintWriter(System.out);
        Scanner sc = new Scanner(System.in)) {
      solve(sc, out);
      out.flush();

    } catch (Exception e) {
      // DO NOT USE
      e.printStackTrace();
    }
  }

  private static void solve(Scanner sc, PrintWriter out) {
    // TODO
    int n = nint(sc);
    int m = nint(sc);
    int c = nint(sc);
    List<Integer> list = getIntegerList(sc, m);
    int ans = 0;

    for (int i = 0; i < n; i++) {
      int a = 0;
      for (int j = 0; j < m; j++) {
        a += nint(sc) * list.get(j);
      }
      if (a + c > 0) {
        ans++;
      }
    }

    out.println(ans);
  }

  // method
  /**
   * Returns an int. int値を受け取り、返します。
   *
   * @param sc Scanner
   * @return int
   */
  private static int nint(Scanner sc) {
    return Integer.parseInt(sc.next());
  }

  /**
   * Returns a long. long値を受け取り、返します。
   *
   * @param sc Scanner
   * @return long
   */
  private static long nlong(Scanner sc) {
    return Long.parseLong(sc.next());
  }

  /**
   * Returns a double. double値を受け取り、返します。
   *
   * @param sc Scanner
   * @return double
   */
  private static double ndouble(Scanner sc) {
    return Double.parseDouble(sc.next());
  }

  /**
   * Returns a String. 文字列を受け取り、返します。
   *
   * @param sc Scanner
   * @return String
   */
  private static String nstr(Scanner sc) {
    return sc.next();
  }

  /**
   * Returns a int array. int値を受け取り、配列にして返します。
   *
   * @param sc Scanner
   * @param length Array length
   * @return int array
   */
  private static int[] intLine(Scanner sc, int length) {
    int[] iLine = new int[length];
    for (int i = 0; i < length; i++) {
      iLine[i] = nint(sc);
    }
    return iLine;
  }

  /**
   * Returns a long array. long値を受け取り、配列にして返します。
   *
   * @param sc Scanner
   * @param length Array length
   * @return long array
   */
  private static long[] longLine(Scanner sc, int length) {
    long[] lLine = new long[length];
    for (int i = 0; i < length; i++) {
      lLine[i] = nlong(sc);
    }
    return lLine;
  }

  /**
   * Returns a String array. 文字列を受け取り、配列にして返します。
   *
   * @param sc Scanner
   * @param length Array length
   * @return String array
   */
  private static String[] strLine(Scanner sc, int length) {
    String[] strLine = new String[length];
    for (int i = 0; i < length; i++) {
      strLine[i] = nstr(sc);
    }
    return strLine;
  }

  /**
   * Returns the maximum value in the list. リスト内で最大値を返します。
   *
   * @param longList List
   * @return long maximum value
   */
  private static long maxFromList(List<Long> longList) {
    return longList.stream().max(Comparator.naturalOrder()).get();
  }

  /**
   * Returns the minimum value in the list. リスト内で最小値を返します。
   *
   * @param longList List
   * @return long minimum value
   */
  private static long minFromList(List<Long> longList) {
    return longList.stream().min(Comparator.naturalOrder()).get();
  }

  /**
   * Returns the sum of each digit. 各桁の和を返します。
   *
   * @param n int
   * @return sum of each digit
   */
  private static int sumDigits(int n) {
    int sum = 0;
    while (n != 0) {
      sum += n % 10;
      n /= 10;
    }
    return sum;
  }

  /**
   * Returns the sum of each digit. 各桁の和を返します。
   *
   * @param n long
   * @return sum of each digit
   */
  private static long sumDigits(long n) {
    long sum = 0;
    while (n != 0) {
      sum += n % 10;
      n /= 10;
    }
    return sum;
  }

  /**
   * Return a list of Integer. Integerのリストを返します。
   *
   * @param sc Scanner
   * @param size list size
   * @return list
   */
  private static List<Integer> getIntegerList(Scanner sc, int size) {
    List<Integer> list = new ArrayList<>();
    for (int i = 0; i < size; i++) {
      list.add(nint(sc));
    }
    return list;
  }

  /**
   * Return a list of Long. Longのリストを返します。
   *
   * @param sc Scanner
   * @param size list size
   * @return list
   */
  private static List<Long> getLongList(Scanner sc, int size) {
    List<Long> list = new ArrayList<>();
    for (int i = 0; i < size; i++) {
      list.add(nlong(sc));
    }
    return list;
  }

  /**
   * Returns the summation of list. リストの要素の合計値を返します。
   *
   * @param list List<Integer>
   * @return sum of list
   */
  private static int sumList(List<Integer> list) {
    int sum = 0;
    for (Integer n : list) {
      sum += n;
    }
    return sum;
  }

  /**
   * Returns the average of list. リストの要素の平均値を返します。
   *
   * @param list List<Integer>
   * @return average of list
   */
  private static double aveList(List<Integer> list) {
    return (double) sumList(list) / list.size();
  }

  /**
   * Returns the greatest common divisor of the two given values. 与えた2つの値の最大公約数を返します。
   *
   * @param m long
   * @param n long
   * @return greatest common divisor
   */
  private static long gcd(long m, long n) {
    if (m < n) return gcd(n, m);
    if (n == 0) return m;
    return gcd(n, m % n);
  }

  /**
   * Returns the least common multiple of the two given values. 与えた2つの値の最小公倍数を返します。
   *
   * @param m long
   * @param n long
   * @return least common multiple
   */
  private static long lcm(long m, long n) {
    return m * n / gcd(m, n);
  }

  /**
   * Returns the most frequent value in the list. リスト内で最頻出数値を返します。
   *
   * @param list List
   * @return most frequent value
   */
  private static Integer mode(List<Integer> list) {
    switch (list.size()) {
      case 0:
        throw new IllegalArgumentException();
      case 1:
        return list.get(0);
      default:
        Integer[] x = new Integer[list.size()];
        list.toArray(x);
        Arrays.sort(x);

        int maxValue = 1,
            maxKey = x[x.length - 1],
            previousKey = x[x.length - 1],
            breakPoint = x.length - 1;
        for (int i = x.length - 2; i >= 0; --i) {
          if (previousKey != x[i]) {
            if (maxValue < breakPoint - i) {
              maxValue = breakPoint - i;
              maxKey = x[i + 1];
            }
            previousKey = x[i];
            breakPoint = i;
          }
        }
        return breakPoint + 1 > maxValue ? x[0] : maxKey;
    }
  }

  private static Map<Integer, Integer> primeFactorize(long num) {
    Map<Integer, Integer> map = new HashMap<>();
    int i = 2;
    while (i * i <= num) {
      while (num % i == 0) {
        num /= i;
        if (map.containsKey(i)) {
          int tmp = map.get(i);
          tmp++;
          map.put(i, tmp);
        } else {
          map.put(i, 1);
        }
      }
      i++;
    }
    if (num > 1) map.put((int) num, 1);
    return map;
  }

  /**
   * Returns "YES" or "NO". アッパーケースのYES,NOを返します。
   *
   * @param bool boolean
   * @return "YES" or "NO"
   */
  private static String upperYESNO(boolean bool) {
    return bool ? "YES" : "NO";
  }

  /**
   * Returns "Yes" or "No". パスカルケースのYes,Noを返します。
   *
   * @param bool boolean
   * @return "Yes" or "No"
   */
  private static String pascalYesNo(boolean bool) {
    return bool ? "Yes" : "No";
  }
} Main

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

/**
 * Hello AtCoder.
 *
 * @author kaito0228
 */
public class Main {
  public static void main(String[] args) {
    try (PrintWriter out = new PrintWriter(System.out);
        Scanner sc = new Scanner(System.in)) {
      solve(sc, out);
      out.flush();

    } catch (Exception e) {
      // DO NOT USE
      e.printStackTrace();
    }
  }

  private static void solve(Scanner sc, PrintWriter out) {
    // TODO
    int n = nint(sc);
    int m = nint(sc);
    int c = nint(sc);
    List<Integer> list = getIntegerList(sc, m);
    int ans = 0;

    for (int i = 0; i < n; i++) {
      int a = 0;
      for (int j = 0; j < m; j++) {
        a += nint(sc) * list.get(j);
      }
      if (a + c > 0) {
        ans++;
      }
    }

    out.println(ans);
  }

  // method
  /**
   * Returns an int. int値を受け取り、返します。
   *
   * @param sc Scanner
   * @return int
   */
  private static int nint(Scanner sc) {
    return Integer.parseInt(sc.next());
  }

  /**
   * Returns a long. long値を受け取り、返します。
   *
   * @param sc Scanner
   * @return long
   */
  private static long nlong(Scanner sc) {
    return Long.parseLong(sc.next());
  }

  /**
   * Returns a double. double値を受け取り、返します。
   *
   * @param sc Scanner
   * @return double
   */
  private static double ndouble(Scanner sc) {
    return Double.parseDouble(sc.next());
  }

  /**
   * Returns a String. 文字列を受け取り、返します。
   *
   * @param sc Scanner
   * @return String
   */
  private static String nstr(Scanner sc) {
    return sc.next();
  }

  /**
   * Returns a int array. int値を受け取り、配列にして返します。
   *
   * @param sc Scanner
   * @param length Array length
   * @return int array
   */
  private static int[] intLine(Scanner sc, int length) {
    int[] iLine = new int[length];
    for (int i = 0; i < length; i++) {
      iLine[i] = nint(sc);
    }
    return iLine;
  }

  /**
   * Returns a long array. long値を受け取り、配列にして返します。
   *
   * @param sc Scanner
   * @param length Array length
   * @return long array
   */
  private static long[] longLine(Scanner sc, int length) {
    long[] lLine = new long[length];
    for (int i = 0; i < length; i++) {
      lLine[i] = nlong(sc);
    }
    return lLine;
  }

  /**
   * Returns a String array. 文字列を受け取り、配列にして返します。
   *
   * @param sc Scanner
   * @param length Array length
   * @return String array
   */
  private static String[] strLine(Scanner sc, int length) {
    String[] strLine = new String[length];
    for (int i = 0; i < length; i++) {
      strLine[i] = nstr(sc);
    }
    return strLine;
  }

  /**
   * Returns the maximum value in the list. リスト内で最大値を返します。
   *
   * @param longList List
   * @return long maximum value
   */
  private static long maxFromList(List<Long> longList) {
    return longList.stream().max(Comparator.naturalOrder()).get();
  }

  /**
   * Returns the minimum value in the list. リスト内で最小値を返します。
   *
   * @param longList List
   * @return long minimum value
   */
  private static long minFromList(List<Long> longList) {
    return longList.stream().min(Comparator.naturalOrder()).get();
  }

  /**
   * Returns the sum of each digit. 各桁の和を返します。
   *
   * @param n int
   * @return sum of each digit
   */
  private static int sumDigits(int n) {
    int sum = 0;
    while (n != 0) {
      sum += n % 10;
      n /= 10;
    }
    return sum;
  }

  /**
   * Returns the sum of each digit. 各桁の和を返します。
   *
   * @param n long
   * @return sum of each digit
   */
  private static long sumDigits(long n) {
    long sum = 0;
    while (n != 0) {
      sum += n % 10;
      n /= 10;
    }
    return sum;
  }

  /**
   * Return a list of Integer. Integerのリストを返します。
   *
   * @param sc Scanner
   * @param size list size
   * @return list
   */
  private static List<Integer> getIntegerList(Scanner sc, int size) {
    List<Integer> list = new ArrayList<>();
    for (int i = 0; i < size; i++) {
      list.add(nint(sc));
    }
    return list;
  }

  /**
   * Return a list of Long. Longのリストを返します。
   *
   * @param sc Scanner
   * @param size list size
   * @return list
   */
  private static List<Long> getLongList(Scanner sc, int size) {
    List<Long> list = new ArrayList<>();
    for (int i = 0; i < size; i++) {
      list.add(nlong(sc));
    }
    return list;
  }

  /**
   * Returns the summation of list. リストの要素の合計値を返します。
   *
   * @param list List<Integer>
   * @return sum of list
   */
  private static int sumList(List<Integer> list) {
    int sum = 0;
    for (Integer n : list) {
      sum += n;
    }
    return sum;
  }

  /**
   * Returns the average of list. リストの要素の平均値を返します。
   *
   * @param list List<Integer>
   * @return average of list
   */
  private static double aveList(List<Integer> list) {
    return (double) sumList(list) / list.size();
  }

  /**
   * Returns the greatest common divisor of the two given values. 与えた2つの値の最大公約数を返します。
   *
   * @param m long
   * @param n long
   * @return greatest common divisor
   */
  private static long gcd(long m, long n) {
    if (m < n) return gcd(n, m);
    if (n == 0) return m;
    return gcd(n, m % n);
  }

  /**
   * Returns the least common multiple of the two given values. 与えた2つの値の最小公倍数を返します。
   *
   * @param m long
   * @param n long
   * @return least common multiple
   */
  private static long lcm(long m, long n) {
    return m * n / gcd(m, n);
  }

  /**
   * Returns the most frequent value in the list. リスト内で最頻出数値を返します。
   *
   * @param list List
   * @return most frequent value
   */
  private static Integer mode(List<Integer> list) {
    switch (list.size()) {
      case 0:
        throw new IllegalArgumentException();
      case 1:
        return list.get(0);
      default:
        Integer[] x = new Integer[list.size()];
        list.toArray(x);
        Arrays.sort(x);

        int maxValue = 1,
            maxKey = x[x.length - 1],
            previousKey = x[x.length - 1],
            breakPoint = x.length - 1;
        for (int i = x.length - 2; i >= 0; --i) {
          if (previousKey != x[i]) {
            if (maxValue < breakPoint - i) {
              maxValue = breakPoint - i;
              maxKey = x[i + 1];
            }
            previousKey = x[i];
            breakPoint = i;
          }
        }
        return breakPoint + 1 > maxValue ? x[0] : maxKey;
    }
  }

  private static Map<Integer, Integer> primeFactorize(long num) {
    Map<Integer, Integer> map = new HashMap<>();
    int i = 2;
    while (i * i <= num) {
      while (num % i == 0) {
        num /= i;
        if (map.containsKey(i)) {
          int tmp = map.get(i);
          tmp++;
          map.put(i, tmp);
        } else {
          map.put(i, 1);
        }
      }
      i++;
    }
    if (num > 1) map.put((int) num, 1);
    return map;
  }

  /**
   * Returns "YES" or "NO". アッパーケースのYES,NOを返します。
   *
   * @param bool boolean
   * @return "YES" or "NO"
   */
  private static String upperYESNO(boolean bool) {
    return bool ? "YES" : "NO";
  }

  /**
   * Returns "Yes" or "No". パスカルケースのYes,Noを返します。
   *
   * @param bool boolean
   * @return "Yes" or "No"
   */
  private static String pascalYesNo(boolean bool) {
    return bool ? "Yes" : "No";
  }
}
