#include<bits/stdc++.h>
using namespace std;

int main(){
    int n,a,ans = 0;
    cin >> n;
    vector<int> num(1000001,0);
    for(int i = 0;i < n;i++){
        cin >> a;
        num[a]++;
    }
    for(int i = 1;i<= 1000000;i++){
        if(num[i] >= 1){
            if(num[i] == 1)ans++;
            for(int j = i;j <= 1000000;j += i){
                num[j] = 0;
            }
        }
    }
    cout << ans << endl;
}
