// Original C++ solution (slower):
#include <cstdio>

#include <cstdlib>

#include <cassert>

#include <algorithm>

#include <functional>

#include <iostream>

#include <map>

#include <numeric>

#include <queue>

#include <set>

#include <stack>

#include <string>

#include <vector>

#define repi(i,a,b) for(ll i=(a);i<(b);++i)

#define rep(i,a) repi(i,0,a)

#define repdi(i,a,b) for(ll i=(a)-1;i>=(b);--i)

#define repd(i,a) repdi(i,a,0)

#define itr(it,a) for( auto it = (a).begin(); it != (a).end(); ++it )

#define all(a) (a).begin(), (a).end()

#define rall(a) (a).rbegin(), (a).rend()



using ll = long long;

using P = std::pair<ll, ll>;



constexpr ll INF = 1ll<<60;



template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }



template<class S, class T>

std::ostream& operator<< ( std::ostream& out, const std::pair<S,T>& a )

{ std::cout << '(' << a.first << ", " << a.second << ')'; return out; }



template<class T>

std::ostream &operator<< ( std::ostream& out, const std::vector<T>& a )

{ std::cout << '['; rep( i, a.size() ){ std::cout << a[i]; if( i != a.size()-1 ) std::cout << ", "; } std::cout << ']'; return out; }



ll N;

ll A[200010];

bool fl[2000010];

ll ma;

ll ans;

ll cnt[2000010];



int main()

{

  std::cin >> N;



  rep( i, N ) {

    std::cin >> A[i];



    ++cnt[A[i]];

  }



  std::sort( A, A+N );



  rep( i, N ) if( !fl[A[i]] ) {

    if( cnt[A[i]] == 1 )

      ++ans;



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

      fl[j*A[i]] = true;

    }

  }



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



  return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstdlib>

#include <cassert>

#include <algorithm>

#include <functional>

#include <iostream>

#include <map>

#include <numeric>

#include <queue>

#include <set>

#include <stack>

#include <string>

#include <vector>

#define repi(i,a,b) for(ll i=(a);i<(b);++i)

#define rep(i,a) repi(i,0,a)

#define repdi(i,a,b) for(ll i=(a)-1;i>=(b);--i)

#define repd(i,a) repdi(i,a,0)

#define itr(it,a) for( auto it = (a).begin(); it != (a).end(); ++it )

#define all(a) (a).begin(), (a).end()

#define rall(a) (a).rbegin(), (a).rend()



using ll = long long;

using P = std::pair<ll, ll>;



constexpr ll INF = 1ll<<60;



template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }



template<class S, class T>

std::ostream& operator<< ( std::ostream& out, const std::pair<S,T>& a )

{ std::cout << '(' << a.first << ", " << a.second << ')'; return out; }



template<class T>

std::ostream &operator<< ( std::ostream& out, const std::vector<T>& a )

{ std::cout << '['; rep( i, a.size() ){ std::cout << a[i]; if( i != a.size()-1 ) std::cout << ", "; } std::cout << ']'; return out; }



ll N;

ll A[200010];

bool fl[2000010];

ll ma;

ll ans;

ll cnt[2000010];



int main()

{

  std::cin >> N;



  rep( i, N ) {

    std::cin >> A[i];



    chmax( ma, A[i] );



    ++cnt[A[i]];

  }



  rep( i, N ) if( !fl[A[i]] ) {

    for( ll j = 2; j*A[i] <= ma; ++j ) {

      fl[j*A[i]] = true;

    }

  }



  rep( i, N ) if( !fl[A[i]] && cnt[A[i]] == 1 )

    ++ans;



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



  return 0;

}

// Fastest known solution for this problem: