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);

	a.sort;

	if (a[0] == 1) {
		if (a.length >= 2 && a[1] == 1) {
			writeln("0");
			return;
		} else {
			writeln("1");
			return;
		}
	}

	auto sieve = new bool[1000008];

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

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