fun main(args : Array<String>){
    while(true){
        val n = readLine()!!.toInt()
        if(n==0) break
        val a = readLine()!!.split(" ").map(String::toInt)
        val ave = a.sum() / n
        val ans= a.filter { v -> v <= ave }.size
        println(ans)
    }
}
