object Main extends App {
  val in = scala.io.Source.stdin.getLines.toSeq
  val ls = in.map(_.split(' ').map(_.toInt).toIndexedSeq)
  val N = ls(0)(0)
  val M = ls(0)(1)
  val C = ls(0)(2)
  val B = ls.tail.head
  val A = ls.tail.tail
  
  val ret = A.map{ a =>
    val macc = a.indices.map{ i =>
      a(i)*B(i)
    }.foldLeft(0)((a,e) => a+e)
    macc + C
  }.count(_ > 0)

  println(ret)
}
