#include<bits/stdc++.h>
#pragma GCC optimize("O2")
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define endl            "\n"
#define forn(i,x,n)     for(int i=x; i<n; i++)
#define forit(it, m)    for(decltype(m)::iterator it = m.begin(); it!=m.end(); ++it)
#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;


void zeus()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

int fast_pow(long long base, long long n, long long M)
{
    if (n == 0)
        return 1;
    if (n == 1)
        return base;
    long long halfn = fast_pow(base, n / 2, M);
    if (n % 2 == 0)
        return ( halfn * halfn ) % M;
    else
        return ( ( ( halfn * halfn ) % M ) * base ) % M;
}

int findMMI_fermat(int n, int M)
{
    return fast_pow(n, M - 2, M);
}

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
    return n - ans.size();
}

int32_t main() {

    zeus();

    int n; cin >> n;

    int a[n];


    forn(i, 0, n) {
        cin >> a[i];
    }

    cout << divisibilityCheck(a, n) << endl;
}




Measured memory_bytes: 32412