const input = require('fs').readFileSync('/dev/stdin', 'utf8').trim()
const lines = input.trim().split("\n")
while (lines.length > 1) {
    const n = parseInt(lines.shift().trim())
    const arr = lines.shift().trim().split(" ").map(Number)
    const avg = arr.reduce((s,v)=> s+ v)/n
    console.log(arr.reduce((rs, v) => v<=avg? rs+1: rs, 0))
}
