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

#define ll long long
#define pb push_back
#define fori(a,b) for(int i=a;i<b;i++)
#define ford(b,a) for(int i=b;i>=a;i--)
typedef pair<int, int> pi;
#define PI 3.14159265359
long long mod=1000000007;
//int count=INT_MAX;

struct hash_pair { 
    template <class T1, class T2> 
    size_t operator()(const pair<T1, T2>& p) const
    { 
        auto hash1 = hash<T1>{}(p.first); 
        auto hash2 = hash<T2>{}(p.second); 
        return hash1 ^ hash2; 
    } 
};

// void solve(vector<int> a,vector<int> b,vector<int> add,vector<int> mult, int &ans,int t){
//     if(a[0]==b[0]&&a[1]==b[1]&&a[2]==b[2]){
//         ans=min(ans,t);
//     }
//     int d;
//     //for a[0]
//     d=add[0];
//     a[0]+=d;
//     add[0]-=d;
//     solve(a,b,add,mult,ans,t+1);
//     a[1]+=d;
//     add[1]-=d;




//     // vector<int> a1(3),vector<int> b1(3);
//     // fori(0,3){
//     //     int d=add[i];
//     //     //add to itself
//     //     a[i]+=d;
//     //     add[i]-=d;
//     //     solve(a,b,add,mult,ans,t+1);
        
//     // }
// }
void divisibilityCheck(int arr[], int n) 
{ 
    int a[n];
    // Storing all array elements in a hash 
    // and finding maximum element in the array 
    unordered_set<int> s;
    //unordered_set 
    int max_ele = INT_MIN; 
    for (int i = 0; i < n; i++) { 
        s.insert(arr[i]); 
        a[i]=arr[i];
        // Update the maximum element of the array 
        max_ele = max(max_ele, arr[i]); 
    } 
  
    // Traversing the array elements and storing the array 
    // multiples that are present in s in res 
    unordered_set<int> res; 
    for (int i = 0; i < n; i++) { 
  
        // Check for non-zero values only 
        if (arr[i] != 0) { 
  
            // Checking the factors of current element 
            for (int j = arr[i] * 2; j <= max_ele; j += arr[i]) { 
  
                // If current factor is already part 
                // of the array then store it 
                if (s.find(j) != s.end()) 
                    res.insert(j); 
            } 
        } 
    } 
  
    // For non-distinct elmments 
    // To store the frequency of elements 
    unordered_map<int, int> mp; 
    for (int i = 0; i < n; i++) 
        mp[arr[i]]++; 
  
    unordered_map<int, int>::iterator it; 
    vector<int> ans; 
    for (it = mp.begin(); it != mp.end(); it++) { 
  
        // If frequency is at least 2 
        if (it->second >= 2) { 
            if (res.find(it->first) == res.end()) { 
  
                // If frequency is greater than 1 and 
                // the number is not divisible by 
                // any other number 
                int val = it->second; 
  
                // Then we push the element number of 
                // times it is present in the vector 
                while (val--) 
                    ans.push_back(it->first); 
            } 
        } 
  
        // If frequency is greater than 1 and the number 
        // is divisible by any other number 
        if (res.find(it->first) != res.end()) { 
            int val = it->second; 
  
            // Then we push the element number of 
            // times it is present in the vector 
            while (val--) 
                ans.push_back(it->first); 
        } 
    } 
  
    // Print the elements that are divisible by 
    // at least one other element from the array 
    // for (auto x : ans) 
    //     cout << x << " "; 
    cout<<n-ans.size()<<endl;
} 

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int t=1;
    //cin>>t;
    //cout<<t;
    //scanf("%d",&t);
    while(t--){
        int n;
        cin>>n;
        int a[n];
        fori(0,n){
            cin>>a[i];
        }
        sort(a,a+n);
        divisibilityCheck(a,n);
        // vector<int> a(3);
        // vector<int> b(3);
        // cin>>a[0]>>a[1]>>a[2]>>b[0]>>b[1]>>b[2];
        // int ans=3;
        // vector<int> add(3);
        // vector<int> mult(3);
        // fori(0,3){
        //     add[i]=b[i]-a[i];
        //     if(b[i]%a[i]==0){
        //         mult[i]=b[i]/a[i];
        //     }
        //     else{
        //         mult[i]=0;
        //     }
        // }
        // if(a[0]==b[0]&&a[1]==b[1]&&a[2]==b[2]){
        //     cout<<0<<endl;
        //     continue;
        // }
        // int t=0;
        // solve(a,b,add,mult,ans,t);
        // if(add[0]==add[1]&&add[1]==add[2]){
        //     cout<<1<<endl;
        //     continue;
        // }
        // if(mult[0]==mult[1]&&mult[1]==add[2]){
        //     cout<<1<<endl;
        //     continue;
        // }
        // if(a[1]==b[1]&&a[2]==b[2]){
        //     cout<<1<<endl;
        //     continue;
        // }
        // if(a[0]==b[0]&&a[2]==b[2]){
        //     cout<<1<<endl;
        //     continue;
        // }
        // if(a[1]==b[1]&&a[0]==b[0]){
        //     cout<<1<<endl;
        //     continue;
        // }

    }
    
    return 0;
}

Measured memory_bytes: 31220