import std.array;
import std.conv;
import std.string;
import std.algorithm;
import std.stdio;

void main() {
	auto length = readln.chomp.to!uint;
	auto a = readln.chomp.split(" ").map!(to!uint).array;
	assert(length >= 1);
	assert(a.length == length);

	auto sieve = new uint[1000008];

	foreach (size_t i, e;a) {
		if (sieve[e] >= 2) {
			continue;
		}
		for (uint j = e;j < sieve.length;j += e) {
			++sieve[j];
		}
	}

	uint answer;
	foreach (e;a) {
		if (sieve[e] == 1) {
			++answer;
		}
	}
	writeln(answer);
}
