unittest
{
	assert( [ "5", "24 11 8 3 16" ].parse.expand.solve == 3 );
	assert( [ "4", "5 5 5 5" ].parse.expand.solve == 0 );
	assert( [ "10", "33 18 45 28 8 19 89 86 2 4" ].parse.expand.solve == 5 );
	
	assert( [ "4", "5 5 6 6" ].parse.expand.solve == 0 );		// 追加ケース
}



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 )
{
	as.sort();
	
	auto ans = 0L;
	auto ds = new bool[ 10L ^^ 6 + 1 ];
	LOOP: foreach( i, a; as )
	{
		if( i + 1 < as.length && as[ i ] == as[ i + 1 ] )
		{
			ds[ a ] = true;
			continue;
		}
		
		auto s = cast( long ) a ^^ 0.5L;
		for( auto d = 1L; d <= s; d++ )
		{
			if( a % d == 0 && ( ds[ d ] || ds[ a / d ] ) ) continue LOOP;
		}
		ds[ a ] = true;
		ans++;
	}
	return ans;
}
