#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#define rep(i, n) for(long long int i = 0; i < (n); i++)
using namespace std;
using P = pair<long long int, long long int>;
long long int mod = (long long int) 1e9 + 7;

int main(){
    
    long long int n;
    cin >> n;

    vector<long long int> a(n, 0);
    vector<long long int> b(1000001, 0);
    vector<long long int> c(1000001, 1);
    

    rep(i, n){
        long long int x;
        cin >> x;
        a[i] = x;
        b[x]++;
    }
    
    sort(a.begin(), a.end());
    
    rep(i, n){
        
        if(c[a[i]] == 0) continue;
        
        for(long long int j = 2; j < 1000001; j++){
            if (j * a[i] > 1000000) continue;
            c[a[i] * j] = 0;
        }
    }

    long long int count = 0;

    rep(i, n) if(b[a[i]] == 1 && c[a[i]] == 1) count++;
    
    cout << count << "\n";

    return 0;
}


