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();
  
  int[] cnt = new int[](MAX);
  foreach(a; as){
    cnt[a] += 1;
    if(cnt[a] >= 2) continue;
    else for(int b = a * 2; b < MAX; b += a) cnt[b] += 1;
  }
  
  int ans = 0;
  foreach(a; as) if(cnt[a] == 1) ans += 1;
  ans.writeln;
}