/*

                              Jai Shree Krishna !!
                                 Radhe Radhe !!
                                 
             उद्यमेन हि सिद्ध्यन्ति कार्याणि न मनोरथैः। नहि सुप्तस्य सिंहस्य मुखे प्रविशन्ति मृगाः।।
             
*/
   
   
#include <bits/stdc++.h>
using namespace std;
 
#define int long long
typedef long long ll;
#define loop(i,n)  for(int i=0;i<n;i++)
#define read(a) int a; cin >>a;
#define readarr(a,n) int a[n] ; for(int i=0;i<n;i++) cin >> a[i];
#define readmat(a,n,m) int a[n][m]; for(int i=0;i<n;i++) for(int j=0;j<m;j++) cin >> a[i][j];
#define pb push_back
#define ff first
#define ss second
#define vi vector<int>
#define pi pair<int,int>
#define vvi vector<vector<int>>
#define sti set<int>
#define vpi vector<pair<int,int>>
#define print(a,n) for(int i=0;i<n;i++) cout<<a[i]<<" "; cout<<endl;
#define printmat(a,n,m) for(int i=0;i<n;i++) {for(int j=0;j<m;j++) cout<<a[i][j]<<" "; cout<<endl;}
#define fast ios_base::sync_with_stdio(false);  cin.tie(NULL);
#define endl "\n"
#define mp make_pair
#define ins insert
#define rep(i,s,e)   for(int i=s;i<=e;i++)
#define repd(i,s,e)  for(int i=e;i>=s;i--)
#define vb vector<bool>
#define read2(n,m) int n,m; cin >> n >> m;
#define range(v) v.begin(),v.end()
#define sortd(v) sort(v.begin(),v.end(),greater<int>())
#define sorti(v) sort(v.begin(),v.end())

const ll inf = 1e18;
const ll mod = 1e9 + 7;
 
map<int,bool> mn;
int divisibilityCheck(int arr[], int n) 
{ 
  
    // Storing all array elements in a hash 
    // and finding maximum element in the array 
    unordered_set<int> s; 
    int max_ele = INT_MIN; 
    for (int i = 0; i < n; i++) { 
        s.insert(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 << " "; 
        return ans.size();
} 
  
signed main()
{
 
    fast;
    int n,x;
    cin >> n;
    readarr(a,n);
    sort(a,a+n);
    int c = divisibilityCheck(a, n); 
    cout<<n-c<<endl;
    return 0;
}

/* Pooja Yadav */

Measured memory_bytes: 32468