#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <iomanip>
using namespace std;
#define int long long

signed main(){
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);

    int n; cin >> n;
    vector<int> a(n);
    for(int i = 0;i < n;i ++) cin >> a.at(i);
    if(n == 1){
        cout << 1 << endl;
        return 0;
    }

    sort(a.begin(),a.end());
    vector<bool> hantei(n,true);

    if(a.at(0) == a.at(1)){
        hantei.at(0) = false;
        hantei.at(1) = false;
    }


    auto itr = lower_bound(a.begin(),a.end(),a.at(0) * 2);
    int x = itr - a.begin();

    for(int j = x;j < n;j ++){

        if(a.at(j) % a.at(0) == 0) hantei.at(j) = false;
    }

    for(int i = 1;i < n-1;i ++){

        if(a.at(i) == a.at(i-1)){
            hantei.at(i) = false;
        }

        if(hantei.at(i) == false) continue;

        if(a.at(i) == a.at(i+1) || a.at(i) == a.at(i-1)){
            hantei.at(i) = false;
        }

        auto itr = lower_bound(a.begin(),a.end(),a.at(i) * 2);
        int x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 2;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }

        itr = lower_bound(a.begin(),a.end(),a.at(i) * 3);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 3;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }

        itr = lower_bound(a.begin(),a.end(),a.at(i) * 4);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 4;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }

        itr = lower_bound(a.begin(),a.end(),a.at(i) * 5);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 5;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }

        itr = lower_bound(a.begin(),a.end(),a.at(i) * 6);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 6;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 7);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 7;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 8);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 8;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 9);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 9;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 10);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 10;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 11);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 11;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 12);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 12;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 13);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 13;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 14);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 14;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 15);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 15;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 16);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 16;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 17);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 17;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 18);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 18;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 19);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 19;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 20);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 20;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 21);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 21;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 22);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 22;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 23);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 23;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 24);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 24;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 25);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 25;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 26);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 26;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 27);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 27;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 28);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 28;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 29);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 29;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 30);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 30;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 31);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 31;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 32);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 32;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 33);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 33;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 34);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 34;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 35);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 35;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 36);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 36;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 37);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 37;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 38);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 38;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 39);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 39;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }
        itr = lower_bound(a.begin(),a.end(),a.at(i) * 40);
        x = itr - a.begin();

        for(int j = x;j < n && a.at(j) <= a.at(i) * 40;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }


        itr = lower_bound(a.begin(),a.end(),a.at(i) * 41);
        x = itr - a.begin();


        for(int j = x;j < n;j ++){
            if(hantei.at(j) == false) continue;
            if(a.at(j) % a.at(i) == 0) hantei.at(j) = false;
        }


    }

    if(a.at(n-2) == a.at(n-1)) hantei.at(n-1) = false;

    int ans = 0;
    for(int i = 0;i < n;i ++){
        if(hantei.at(i) == true) ans ++;
    }

    cout << ans << endl;

}

Measured memory_bytes: 4796