import std;
const int MAX = 1_000_009;
void main(){
  int n = readln.chomp.to!int;
  int[] as = readln.chomp.split.to!(int[]);
  as.sort();
  bool[] isNG = new bool[](MAX);
  foreach(a; as){
    if(isNG[a]) continue;
    for(int b = a * 2; b < MAX; b += a) isNG[b] = 1;
  }
  int ans;
  foreach(a; as) if(! isNG[a]) ans += 1;
    
  ans.writeln;
}