
object Main extends App{
  import scala.io.StdIn._

  var n = readLine.trim.toInt
  while (n != 0) {
    val nums = readLine.trim.split(' ').map(_.toDouble)
    val avg = nums.sum / n
    println(nums.count(_ <= avg))
    n = readLine.trim.toInt
  }
}
