unittest
{
	assert( [ "3", "3 1 4" ].parse.expand.solve == 2 );
	assert( [ "5", "1 1 1 1 1" ].parse.expand.solve == 5 );
	assert( [ "6", "40 1 30 2 7 20" ].parse.expand.solve == 4 );
}



import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	input.popFront;
	auto as = input.front.split.to!( long[] );
	return tuple( as );
}

auto solve( long[] as )
{
	auto ans = 0L;
	auto t = 0L;
	foreach( a; as.sort() )
	{
		if( a <= t * 2 ) ans++;
		else             ans = 1;
		t += a;
	}
	return ans;
}
