import java.util.PriorityQueue

fun main(args: Array<String>) {
  val N = readInputLine().toInt()
  val queue = PriorityQueue<Pair<Long, Int>>(N) { x, y -> x.first.compareTo(y.first) }
  
  readInputLine().split(" ").map {
    queue.add(Pair(it.toLong(), 1))
  }
  
  while (queue.size != 1) {
    val (size1, color1) = queue.poll()!!
    val (size2, color2) = queue.poll()!!
    
    if (size1 * 2L < size2) {
      queue.add(Pair(size1 + size2, color2))
    } else {
      queue.add(Pair(size1 + size2, color1 + color2))
    }
  }
  
  println(queue.poll()!!.second)
}

fun readInputLine(): String {
  return readLine()!!
}
