#include<bits/stdc++.h>            //  IT'S NEVER TOO LATE...
    	using namespace std;
        #include<math.h>
    	#define ll long long
    	#define fore(i, l, r) for(int i = int(l); i < int(r); ++i)
        #define forn(i, n) fore(i, 0, n)
        #define fori(i, l, r) fore(i, l, (r) + 1)
        #define sz(v) int((v).size())
        #define all(v) (v).begin(), (v).end()
        #define pb push_back
        #define mp make_pair
        #define ff first
        #define ss second

        const double PI = atan(1)*4;

        int dx[8]={1,0,-1,0,1,-1,-1,1};
        int dy[8]={0,1,0,-1,1,1,-1,-1};

    	
    	vector<int> ar[1000001];
        vector<pair<int,int>> path;
        int vis[1000001],dis[1000001];

        /*void dfs(int node)
        {
            vis[node]=1;

            for(int child : ar[node])
            {
                if(vis[child]==0)
                {
                    dis[child]=dis[node]+1;
                    dfs(child);
                }
            }
        }*/

    /*    void bfs(int i)
        {
            queue<int> q;
            q.push(i);
            vis[i]=1;
            dis[i]=0;

            while(!q.empty())
            {
                int curr=q.front();
                q.pop();

                for(int child : ar[curr])
                    if(vis[child]==0)
                    {
                        q.push(child);
                        dis[child]=dis[curr]+1;
                        vis[child]=1;
                    }
            }
        }*/

        bool isprime(int n)
        {
            for(int i=2;i*i<=n;i++)
                if(n%i==0)
                    return false;
            return true;
        }

        bool comp(pair<int,int> a, pair<int,int> b)
        {
            return b.ff < a.ff ;
        }

        int modpow(int b,int p,int m)
        {
            if(p==0) return 1%m;
            if(p%2) return (b*modpow(b,p-1,m))%m;
            int u=modpow(b,p/2,m);
            return (u*u)%m;
        }

    	int main()  
    	{

    		int t=1;
    		//cin>>t;
    		
    		while(t--)
    		{
                int n;
                cin>>n;

                int a[n];
                map<int,int> m;
                forn(i,n)
                {
                    cin>>a[i];
                    m[a[i]]++;
                }

                int cnt=0;
                forn(i,n)
                {
                    int z=a[i],ok=0;
                    if(m[z]>1)
                    {
                        continue;
                    }
                    if(a[i]!=1 && m[1])
                    {
                        ok=1;
                        continue;
                    }
                    fori(j,2,sqrt(z))
                    {
                        
                        if(z%j == 0)
                        {
                            if(m[j] || m[z/j] )
                            {
                                ok=1;
                                break;
                            }
                        }
                    }
                    if(ok==0)
                    {
                        //cout<<i+1<<" ";
                        cnt++;
                    }
                }

                cout<<cnt;
            }
            return 0;
    	}

        //              NOW IT'S TIME TO WAKE UP...

Measured memory_bytes: 56508