///S->----------------------------------------------------|
///R->--------------</AUTHOR - SRIJAN DE>-----------------|
///I->--------</https://thesrijande.github.io/>-----------|
///J->----</JALPAIGURI GOVERNMENT ENGINEERING COLLEGE>----|
///A->------------</INFORMATION TECHNOLOGY>---------------|
///N->----------------------------------------------------|
#include    <bits/stdc++.h>
using       namespace            std;
using       ll =                 int64_t ;
using       ull =                unsigned long long ;
using       ld =                 long double;
#define     int                  int64_t
#define     mem(a,val)           memset( a,  val,  sizeof(a) )
#define     b_s                  binary_search
#define     u_b                  upper_bound
#define     l_b                  lower_bound
#define     nl                   cout<<endl
#define     pb                   push_back
#define     pf                   push_front
#define     ppb                  pop_back
#define     ppf                  pop_front
#define     in                   insert
#define     fi                   first
#define     se                   second
#define     umap                 unordered_map
#define     pqueue               priority_queue
#define     rr                   return
#define     bits(n)              __builtin_popcount(n)
const int   N =                   1e6 + 7;
const int   MOD =                 (int)1e9 + 7;
const int   MOD1 =                (int)1e9 + 9;
const int   MOD2 =                998244353;
const ld    pi =                  atan2(0, -1);
const ld    eps =                 1e-9;
int         tests =               1;
template<class x, class y>x max(x a, y b) {
    return (a > b) ? a : b;
}
template<class x, class y>x min(x a, y b) {
    return (a < b) ? a : b;
}
template<class x, class y>x log(x n, y r) {
    return (n > r - 1) ? 1 + log(n / r, r) : 0;
}
///.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'
vector<int> adj[N], subset;
int vis[N] = {0};
///.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.
int32_t main()
{
    auto start = clock();
    ios_base::sync_with_stdio(0);
    cout.tie(0);
    cin.tie(0);
// #ifndef ONLINE_JUDGE
//     {
//         freopen("input.txt", "r", stdin);
//         freopen("output.txt", "w", stdout);
//         freopen("error.txt", "w", stderr);
//     }
// #endif
//  cout<<fixed;
//  cout<<scientific;
//  cout<<fixed<<setprecision(12);
    // cin >> tests;
    for (int test = 1; test <= tests; test++)
    {
        // cout<<"Case #"<<test<<": ";
///.'.'.'.'.'.'.'.'.'.'.'.'.'   .'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.
        int n;
        cin >> n;
        int a[n], h[N] = {0};
        for (int i = 0; i < n; i++)
        {
            cin >> a[i];
            h[a[i]] ++;
        }
        int ctr = n;
        for (int i = 0; i < n; i++)
        {
            int nm = a[i];
            for (int j = 1; j <= sqrt(nm); j++)
            {
                if (nm % j == 0)
                {
                    if (h[j] >0)
                    {
                        if(h[j]==1 && j==a[i])
                        {
                            ctr++;
                            ctr--;
                        }
                        else
                        {
                            ctr--;
                            break;
                        }
                    }
                    if(h[nm / j] >0)
                    {
                        if(h[nm/j]==1 && nm/j==a[i])
                        {
                            ctr++;
                            ctr--;
                        }
                        else
                        {
                            ctr--;
                            break;
                        }
                    }
                }
            }
        }

        cout << ctr;








///.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.

    }
    cerr << endl << endl <<  endl <<
         "Time : " << double(clock() - start) / CLOCKS_PER_SEC << endl;
    return 0;
}


Measured memory_bytes: 36556