fun main(){val w=readLine()!!.toInt() readLine() println(readLine()!!.split(" ").map{it.toInt()}.sorted().takeWhile{it<=w}.count())}