object Main{
	def main(A:Array[String]){
		val s = new java.util.Scanner(System.in)
		val n,m,c=s.nextInt
		val b=Seq.fill(m)(s.nextInt)
		def f=Seq.tabulate(m)(o=>b(o)*s.nextInt).sum+c>0

		println(1 to n count(_=>f))
	}
}
