void main() {
  problem();
}

void problem() {
  auto N = scan!int;
  auto A = scan!int(N);

  int solve2() {
    int answer;
    auto sorted = A.sort.array;
    bool[int] divisers;

    bool hasOne = sorted[0] == 1;

    foreach(i, s; sorted) {
      divisers[s] = true;
      if (i < N-1 && sorted[i+1] == s) continue;
      if (i > 0 && sorted[i-1] == s) continue;

      if (!hasOne && isPrime(s)) {
        answer++;
        continue;
      }

      bool divisible;
      foreach(x; divisers.keys) {
        if (x == s) continue;
        if (s % x == 0) {
          divisible = true;
          divisers.remove(s);
          break;
        }
      }

      if (divisible) continue;
      
      answer++;
    }

    return answer;
  }

  solve2().writeln;
}

// ----------------------------------------------

import std.stdio, std.conv, std.array, std.string, std.algorithm, std.container, std.range, core.stdc.stdlib, std.math, std.typecons, std.numeric;
T[][] combinations(T)(T[] s, in int m) {   if (!m) return [[]];   if (s.empty) return [];   return s[1 .. $].combinations(m - 1).map!(x => s[0] ~ x).array ~ s[1 .. $].combinations(m); }
string scan(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }
T scan(T)(){ return scan.to!T; }
T[] scan(T)(int n){ return n.iota.map!(i => scan!T()).array; }
void deb(T ...)(T t){ debug writeln(t); }
alias Point = Tuple!(long, "x", long, "y");
bool isPrime(int n){if (n == 2){    return true;}else if (n % 2 == 0 || n < 2){    return false;}else{    for (int i = 3; i <= sqrt(float(n)); i += 2)    {        if (n % i == 0)        {            return false;        }    }}return true;}

// -----------------------------------------------
