import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

  public static void main(String[] args) {

    try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      final String[] tmp1 = br.readLine().split("\\s");
      final int n = Integer.parseInt(tmp1[0]);
      final int m = Integer.parseInt(tmp1[1]);
      final int c = Integer.parseInt(tmp1[2]);

      final int[] b = new int[m];
      final String[] tmp2 = br.readLine().split("\\s");
      for (int i = 0; i < tmp2.length; i++) {
        b[i] = Integer.parseInt(tmp2[i]);
      }

      int result = 0;

      final int[][] a = new int[n][m];
      for (int i = 0; i < a.length; i++) {
        int sum = 0;
        final String[] tmp3 = br.readLine().split("\\s");
        for (int j = 0; j < a[i].length; j++) {
          a[i][j] = Integer.parseInt(tmp3[j]);
          sum += a[i][j] * b[j];
        }
        if (0 < sum + c) {
          result++;
        }
      }
      System.out.print(result);

    } catch (IOException e) {
      e.printStackTrace();
      System.exit(1);
    }
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

  public static void main(String[] args) {

    try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      final String[] tmp1 = br.readLine().split("\\s");
      final int n = Integer.parseInt(tmp1[0]);
      final int m = Integer.parseInt(tmp1[1]);
      final int c = Integer.parseInt(tmp1[2]);

      final int[] b = new int[m];
      final String[] tmp2 = br.readLine().split("\\s");
      for (int i = 0; i < tmp2.length; i++) {
        b[i] = Integer.parseInt(tmp2[i]);
      }

      int result = 0;

      final int[][] a = new int[n][m];
      for (int i = 0; i < a.length; i++) {
        int sum = 0;
        final String[] tmp3 = br.readLine().split("\\s");
        for (int j = 0; j < a[i].length; j++) {
          a[i][j] = Integer.parseInt(tmp3[j]);
          sum += a[i][j] * b[j];
        }
        if (0 < sum + c) {
          result++;
        }
      }
      System.out.print(result);

    } catch (IOException e) {
      e.printStackTrace();
      System.exit(1);
    }
  }
} Main public static void main(String[] args) {

    try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      final String[] tmp1 = br.readLine().split("\\s");
      final int n = Integer.parseInt(tmp1[0]);
      final int m = Integer.parseInt(tmp1[1]);
      final int c = Integer.parseInt(tmp1[2]);

      final int[] b = new int[m];
      final String[] tmp2 = br.readLine().split("\\s");
      for (int i = 0; i < tmp2.length; i++) {
        b[i] = Integer.parseInt(tmp2[i]);
      }

      int result = 0;

      final int[][] a = new int[n][m];
      for (int i = 0; i < a.length; i++) {
        int sum = 0;
        final String[] tmp3 = br.readLine().split("\\s");
        for (int j = 0; j < a[i].length; j++) {
          a[i][j] = Integer.parseInt(tmp3[j]);
          sum += a[i][j] * b[j];
        }
        if (0 < sum + c) {
          result++;
        }
      }
      System.out.print(result);

    } catch (IOException e) {
      e.printStackTrace();
      System.exit(1);
    }
  } main {

    try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      final String[] tmp1 = br.readLine().split("\\s");
      final int n = Integer.parseInt(tmp1[0]);
      final int m = Integer.parseInt(tmp1[1]);
      final int c = Integer.parseInt(tmp1[2]);

      final int[] b = new int[m];
      final String[] tmp2 = br.readLine().split("\\s");
      for (int i = 0; i < tmp2.length; i++) {
        b[i] = Integer.parseInt(tmp2[i]);
      }

      int result = 0;

      final int[][] a = new int[n][m];
      for (int i = 0; i < a.length; i++) {
        int sum = 0;
        final String[] tmp3 = br.readLine().split("\\s");
        for (int j = 0; j < a[i].length; j++) {
          a[i][j] = Integer.parseInt(tmp3[j]);
          sum += a[i][j] * b[j];
        }
        if (0 < sum + c) {
          result++;
        }
      }
      System.out.print(result);

    } catch (IOException e) {
      e.printStackTrace();
      System.exit(1);
    }
  } try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      final String[] tmp1 = br.readLine().split("\\s");
      final int n = Integer.parseInt(tmp1[0]);
      final int m = Integer.parseInt(tmp1[1]);
      final int c = Integer.parseInt(tmp1[2]);

      final int[] b = new int[m];
      final String[] tmp2 = br.readLine().split("\\s");
      for (int i = 0; i < tmp2.length; i++) {
        b[i] = Integer.parseInt(tmp2[i]);
      }

      int result = 0;

      final int[][] a = new int[n][m];
      for (int i = 0; i < a.length; i++) {
        int sum = 0;
        final String[] tmp3 = br.readLine().split("\\s");
        for (int j = 0; j < a[i].length; j++) {
          a[i][j] = Integer.parseInt(tmp3[j]);
          sum += a[i][j] * b[j];
        }
        if (0 < sum + c) {
          result++;
        }
      }
      System.out.print(result);

    } catch (IOException e) {
      e.printStackTrace();
      System.exit(1);
    } catch (IOException e) {
      e.printStackTrace();
      System.exit(1);
    } IOException e {
      e.printStackTrace();
      System.exit(1);
    } e.printStackTrace() e.printStackTrace e System.exit(1) System.exit System 1 {

      final String[] tmp1 = br.readLine().split("\\s");
      final int n = Integer.parseInt(tmp1[0]);
      final int m = Integer.parseInt(tmp1[1]);
      final int c = Integer.parseInt(tmp1[2]);

      final int[] b = new int[m];
      final String[] tmp2 = br.readLine().split("\\s");
      for (int i = 0; i < tmp2.length; i++) {
        b[i] = Integer.parseInt(tmp2[i]);
      }

      int result = 0;

      final int[][] a = new int[n][m];
      for (int i = 0; i < a.length; i++) {
        int sum = 0;
        final String[] tmp3 = br.readLine().split("\\s");
        for (int j = 0; j < a[i].length; j++) {
          a[i][j] = Integer.parseInt(tmp3[j]);
          sum += a[i][j] * b[j];
        }
        if (0 < sum + c) {
          result++;
        }
      }
      System.out.print(result);

    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) final String[] tmp1 = br.readLine().split("\\s"); tmp1 br.readLine().split("\\s") br.readLine().split br.readLine() br.readLine br "\\s" final int n = Integer.parseInt(tmp1[0]); n Integer.parseInt(tmp1[0]) Integer.parseInt Integer tmp1[0] tmp1 0 final int m = Integer.parseInt(tmp1[1]); m Integer.parseInt(tmp1[1]) Integer.parseInt Integer tmp1[1] tmp1 1 final int c = Integer.parseInt(tmp1[2]); c Integer.parseInt(tmp1[2]) Integer.parseInt Integer tmp1[2] tmp1 2 final int[] b = new int[m]; b new int[m] m final String[] tmp2 = br.readLine().split("\\s"); tmp2 br.readLine().split("\\s") br.readLine().split br.readLine() br.readLine br "\\s" for (int i = 0; i < tmp2.length; i++) {
        b[i] = Integer.parseInt(tmp2[i]);
      } int i = 0; int i = 0; i 0 i < tmp2.length i tmp2.length tmp2 tmp2.length i++ i++ i {
        b[i] = Integer.parseInt(tmp2[i]);
      } {
        b[i] = Integer.parseInt(tmp2[i]);
      } b[i] = Integer.parseInt(tmp2[i]) b[i] b i Integer.parseInt(tmp2[i]) Integer.parseInt Integer tmp2[i] tmp2 i int result = 0; result 0 final int[][] a = new int[n][m]; a new int[n][m] n m for (int i = 0; i < a.length; i++) {
        int sum = 0;
        final String[] tmp3 = br.readLine().split("\\s");
        for (int j = 0; j < a[i].length; j++) {
          a[i][j] = Integer.parseInt(tmp3[j]);
          sum += a[i][j] * b[j];
        }
        if (0 < sum + c) {
          result++;
        }
      } int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i {
        int sum = 0;
        final String[] tmp3 = br.readLine().split("\\s");
        for (int j = 0; j < a[i].length; j++) {
          a[i][j] = Integer.parseInt(tmp3[j]);
          sum += a[i][j] * b[j];
        }
        if (0 < sum + c) {
          result++;
        }
      } {
        int sum = 0;
        final String[] tmp3 = br.readLine().split("\\s");
        for (int j = 0; j < a[i].length; j++) {
          a[i][j] = Integer.parseInt(tmp3[j]);
          sum += a[i][j] * b[j];
        }
        if (0 < sum + c) {
          result++;
        }
      } int sum = 0; sum 0 final String[] tmp3 = br.readLine().split("\\s"); tmp3 br.readLine().split("\\s") br.readLine().split br.readLine() br.readLine br "\\s" for (int j = 0; j < a[i].length; j++) {
          a[i][j] = Integer.parseInt(tmp3[j]);
          sum += a[i][j] * b[j];
        } int j = 0; int j = 0; j 0 j < a[i].length j a[i].length a[i] a i a[i].length j++ j++ j {
          a[i][j] = Integer.parseInt(tmp3[j]);
          sum += a[i][j] * b[j];
        } {
          a[i][j] = Integer.parseInt(tmp3[j]);
          sum += a[i][j] * b[j];
        } a[i][j] = Integer.parseInt(tmp3[j]) a[i][j] a[i] a i j Integer.parseInt(tmp3[j]) Integer.parseInt Integer tmp3[j] tmp3 j sum += a[i][j] * b[j] sum a[i][j] * b[j] a[i][j] a[i] a i j b[j] b j if (0 < sum + c) {
          result++;
        } 0 < sum + c 0 sum + c sum c {
          result++;
        } result++ result System.out.print(result) System.out.print System.out System System.out result String[] args args public class Main {

  public static void main(String[] args) {

    try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      final String[] tmp1 = br.readLine().split("\\s");
      final int n = Integer.parseInt(tmp1[0]);
      final int m = Integer.parseInt(tmp1[1]);
      final int c = Integer.parseInt(tmp1[2]);

      final int[] b = new int[m];
      final String[] tmp2 = br.readLine().split("\\s");
      for (int i = 0; i < tmp2.length; i++) {
        b[i] = Integer.parseInt(tmp2[i]);
      }

      int result = 0;

      final int[][] a = new int[n][m];
      for (int i = 0; i < a.length; i++) {
        int sum = 0;
        final String[] tmp3 = br.readLine().split("\\s");
        for (int j = 0; j < a[i].length; j++) {
          a[i][j] = Integer.parseInt(tmp3[j]);
          sum += a[i][j] * b[j];
        }
        if (0 < sum + c) {
          result++;
        }
      }
      System.out.print(result);

    } catch (IOException e) {
      e.printStackTrace();
      System.exit(1);
    }
  }
} public class Main {

  public static void main(String[] args) {

    try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      final String[] tmp1 = br.readLine().split("\\s");
      final int n = Integer.parseInt(tmp1[0]);
      final int m = Integer.parseInt(tmp1[1]);
      final int c = Integer.parseInt(tmp1[2]);

      final int[] b = new int[m];
      final String[] tmp2 = br.readLine().split("\\s");
      for (int i = 0; i < tmp2.length; i++) {
        b[i] = Integer.parseInt(tmp2[i]);
      }

      int result = 0;

      final int[][] a = new int[n][m];
      for (int i = 0; i < a.length; i++) {
        int sum = 0;
        final String[] tmp3 = br.readLine().split("\\s");
        for (int j = 0; j < a[i].length; j++) {
          a[i][j] = Integer.parseInt(tmp3[j]);
          sum += a[i][j] * b[j];
        }
        if (0 < sum + c) {
          result++;
        }
      }
      System.out.print(result);

    } catch (IOException e) {
      e.printStackTrace();
      System.exit(1);
    }
  }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

  public static void main(String[] args) {

    try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      final String[] tmp1 = br.readLine().split("\\s");
      final int n = Integer.parseInt(tmp1[0]);
      final int m = Integer.parseInt(tmp1[1]);
      final int c = Integer.parseInt(tmp1[2]);

      final int[] b = new int[m];
      final String[] tmp2 = br.readLine().split("\\s");
      for (int i = 0; i < tmp2.length; i++) {
        b[i] = Integer.parseInt(tmp2[i]);
      }

      int result = 0;

      final int[][] a = new int[n][m];
      for (int i = 0; i < a.length; i++) {
        int sum = 0;
        final String[] tmp3 = br.readLine().split("\\s");
        for (int j = 0; j < a[i].length; j++) {
          a[i][j] = Integer.parseInt(tmp3[j]);
          sum += a[i][j] * b[j];
        }
        if (0 < sum + c) {
          result++;
        }
      }
      System.out.print(result);

    } catch (IOException e) {
      e.printStackTrace();
      System.exit(1);
    }
  }
}
