#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#include<string.h>
#include<math.h>
#include<ctype.h>

typedef long long ll;

ll mygcd(ll a, ll b) { if (b == 0) return a; return mygcd(b, a % b); }

ll mylcm(ll a, ll b) { return a / mygcd(a, b) * b; }

ll mymax(ll a, ll b) { return (a > b) ? a : b; }

ll mymin(ll a, ll b) { return (a < b) ? a : b; }

ll myasc(const void* a, const void* b) { return *(ll*)a - *(ll*)b; }

ll mydsc(const void* a, const void* b) { return *(ll*)b - *(ll*)a; }

bool flag;
ll n, a[200000], ans,M;
bool check[1000001],used[1000001];


int main() {
	scanf("%lld", &n );
	for (int i = 0; i < n; i++) {
		scanf("%lld", &a[i]);
		M = mymax(M, a[i]);
	}
	for (int i = 0; i < n; i++) {
		for (int j = 2; j * a[i] <= M; j++) {
			check[j * a[i]] = true;
		}
	}
	for (int i = 0; i < n; i++) {
		if (!check[a[i]]&&used[a[i]]) {
          ans++;
          used[a[i]]=true;
        }
	}
	printf("%lld", ans);

	return 0;
}