object Main extends App {
  val in1 = io.StdIn.readLine.split(' ').map(_.toInt)

  val N = in1(0)
  val M = in1(1)
  val C = in1(2)

  val B = io.StdIn.readLine.split(' ').map(_.toInt)

  val As = for (i <- 1 to N) yield io.StdIn.readLine.split(' ').map(_.toInt)

  val out = As.count{ a =>
    (0 until a.size).map(i => a(i)*B(i)).sum + C > 0
  }

  println(out)
}

