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

#define ll long long int
ll mod = 1e9 + 7;

// vector<ll> g[200005];
// ll vis[200005];
// queue<ll> q;
// ll level[200005];

// void dfs(ll i)
// {
//     vis[i] = 1;
//     for(ll j=0;j<g[i].size();j++)
//     {
//         ll child = g[i][j];
//         if(vis[child] == 0)
//         {
//             dfs(child);
//         }
//     }
// }

// void bfs(ll i)
// {
//     vis[i] = 1;
//     while(!q.empty())
//     {
//         ll top = q.front();
//         ll len_adj = g[top].size();
//         ll j;
//         for(j=0;j<len_adj;j++)
//         {
//             ll v = g[top][j];
//             if(vis[v]==0)
//             {
//                 vis[v]=1;
//                 q.push(v);
//                 level[v] = level[top] + 1;
//             }
//         }
//         q.pop();
//     }
// }

vector<ll> DecToBinary(ll num, ll trailing_zero, ll nbits)
{
    vector<ll> bits;
    while (num > 0)
    {
        bits.push_back(num % 2);
        num /= 2;
    }

    if (trailing_zero == 1)
    {
        while (bits.size() < nbits)
        {
            bits.push_back(0);
        }
    }

    return bits;
}

long long int BinaryToDec(vector<ll> bits)
{
    ll number = 0;
    ll i;
    for (i = bits.size() - 1; i >= 0; i--)
    {
        number += (bits[i] * (long long)pow((ll)2, i));
    }
    return number;
}

ll modular_exponentiation(ll base, ll power)
{
    ll ans = 1;
    base = base % mod;
    while (power > 0)
    {
        if (power & 1)
        {
            ans = (ans * base) % mod;
        }

        power /= 2;
        base = (base * base) % mod;
    }
    return ans;
}

#define MAXNN 1000001 
int spf[MAXNN];

void sieve(int MAXN)
{
    spf[1] = 1;
    for (int i = 2; i < MAXN; i++)
    {
        // marking smallest prime factor for every
        // number to be itself.
        spf[i] = i;
    }

    // separately marking spf for every even
    // number as 2
    for (int i = 4; i < MAXN; i += 2)
        spf[i] = 2;

    for (int i = 3; i * i < MAXN; i++)
    {
        // checking if i is prime
        if (spf[i] == i)
        {
            // marking SPF for all numbers divisible by i
            for (int j = i * i; j < MAXN; j += i)

                // marking spf[j] if it is not
                // previously marked
                if (spf[j] == j)
                    spf[j] = i;
        }
    }
}

unordered_map<int, int> mp;

vector<int> getFactorization(int x)
{
    vector<int> ret;
    while (x != 1)
    {
        ret.push_back(spf[x]);
        x = x / spf[x];
    }
    return ret;
}

int main()
{
    /* Faster input ouput */
    // ios_base::sync_with_stdio(false);
    // cin.tie(NULL);
    // cout.tie(NULL);

    /* To read input from a file and output to a file */
    // freopen("input.txt","r",stdin);
    // freopen("output.txt","w",stdout);

    ll t = 1;
    // cin >> t;
    while (t--)
    {
        ll n, i, j;
        cin >> n;
        ll arr[n];
        mp.clear();
        sieve(n+1);
        for (i = 0; i < n; i++)
        {
            cin >> arr[i];
            auto it = mp.find(arr[i]);
            if (it == mp.end())
            {
                mp[arr[i]] = 1;
            }
            else
            {
                mp[arr[i]]++;
            }
        }

        int nott = 0;
        for (i = 0; i < n; i++)
        {
            ll num = arr[i];
            // auto itr = mp.find(1);
            // if(itr != mp.end())
            // {
            //     nott++;
            //     continue;
            // }
            
            // itr = mp.find(num);
            // if(itr->second > 1)
            // {
            //     nott++;
            //     continue;
            // }

            for (j = 1; j <= sqrt(num); j++)
            {
                if (num % j == 0)
                {
                    if (num / j == j)
                    {
                        auto it = mp.find(j);
                        if (it != mp.end())
                        {
                            if (j != num)
                            {
                                nott++;
                                break;
                            }
                            else
                            {
                                // j == num
                                if(it->second > 1)
                                {
                                    nott++;
                                    break;
                                }
                            }
                        }
                    }
                    else
                    {
                        auto it1 = mp.find(j);
                        auto it2 = mp.find(num / j);
                        if (it1 != mp.end())
                        {
                            if (j != num)
                            {
                                nott++;
                                break;
                            }
                            else
                            {
                                // j == num
                                if(it1->second > 1)
                                {
                                    nott++;
                                    break;
                                }
                            }

                        }

                        if (it2 != mp.end())
                        {
                            if ((num/j) != num)
                            {
                                nott++;
                                break;
                            }
                            else
                            {
                                // j == num
                                if(it2->second > 1)
                                {
                                    nott++;
                                    break;
                                }
                            }
                        }
                    }
                }
            }

            // cout << "\nNott = " << nott << '\n'; 
        }

        cout << n - nott << '\n';
    }
}

Measured memory_bytes: 13632