// Slower C++ solution:
#define _USE_MATH_DEFIMES

#include <algorithm>

#include <array>

#include <bitset>

#include <cassert>

#include <cctype>

#include <climits>

#include <clocale>

#include <cmath>

#include <complex>

#include <cstdio>

#include <cstdlib>

#include <ctime>

#include <deque>

#include <fstream>

#include <functional>

#include <iomanip>

#include <iostream>

#include <iterator>

#include <list>

#include <map>

#include <numeric>

#include <queue>

#include <regex>

#include <set>

#include <sstream>

#include <stack>

#include <string>

#include <tuple>

#include <unordered_map>

#include <unordered_set>

#include <utility>

#include <vector>



const int MOD = 1'000'000'007;

const int INF = 1'000'000'000; //1e9

const int NIL = -1;

const long long LINF = 1'000'000'000'000'000'000; // 1e18

const long double EPS = 1E-10;



template<class T, class S> inline bool chmax(T &a, const S &b){

    if(a < b){

        a = b; return true;

    }

    return false;

}

template<class T, class S> inline bool chmin(T &a, const S &b){

    if(b < a){

        a = b; return true;

    }

    return false;

}

















int main(){

    int N; std::cin >> N;

    std::vector<int> A(N), cnt(1'000'001, 0);

    for(int i(0); i < N; ++i){

        std::cin >> A[i];

        ++cnt[A[i]];

    }

    int ans(0);

    for(int i(0); i < N; ++i){

        if(cnt[A[i]] > 1) continue;

        if(A[i] == 1){

            ++ans;

            continue;

        }

        bool okay(true);

        for(int j(1); j*j <= A[i]; ++j){

            if(!(A[i] % j)){

                if(cnt[j]){

                    okay = false; break;

                }

                if(j != 1 && cnt[A[i]/j]){

                    okay = false; break;

                }

            }

        }

        if(okay) ++ans;

    }

    std::cout << ans << std::endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.101906683851654x):
#define _USE_MATH_DEFIMES

#include <algorithm>

#include <array>

#include <bitset>

#include <cassert>

#include <cctype>

#include <climits>

#include <clocale>

#include <cmath>

#include <complex>

#include <cstdio>

#include <cstdlib>

#include <ctime>

#include <deque>

#include <fstream>

#include <functional>

#include <iomanip>

#include <iostream>

#include <iterator>

#include <list>

#include <map>

#include <numeric>

#include <queue>

#include <regex>

#include <set>

#include <sstream>

#include <stack>

#include <string>

#include <tuple>

#include <unordered_map>

#include <unordered_set>

#include <utility>

#include <vector>



const int MOD = 1'000'000'007;

const int INF = 1'000'000'000; //1e9

const int NIL = -1;

const long long LINF = 1'000'000'000'000'000'000; // 1e18

const long double EPS = 1E-10;



template<class T, class S> inline bool chmax(T &a, const S &b){

    if(a < b){

        a = b; return true;

    }

    return false;

}

template<class T, class S> inline bool chmin(T &a, const S &b){

    if(b < a){

        a = b; return true;

    }

    return false;

}















int main(){

    int N; std::cin >> N;

    std::vector<int> A(N);

    int mxa(0);

    for(int i(0); i < N; ++i){

        std::cin >> A[i];

        chmax(mxa, A[i]);

    }

    std::sort(std::begin(A), std::end(A));

    std::vector<bool> okay(mxa + 1, true), has(mxa + 1, false);

    for(int i(0); i < N; ++i){

        if(has[A[i]]) okay[A[i]] = false;

        if(okay[A[i]]){

            for(int j(2*A[i]); j <= mxa; j += A[i]){

                okay[j] = false;

            }

            has[A[i]] = true;

        }

    }

    int ans(0);

    for(int i(0); i < N; ++i) if(okay[A[i]]) ++ans;

    std::cout << ans << std::endl;

    return 0;

}