#include <bits/stdc++.h>
#define __SHI__ signed main()
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define INF (int)1e18
#define vi vector<int>
#define vii vector<int,int>
#define MAXN (int)1e6 + 8
#define FOR(i, a, b) for (int i = a; i <= b; ++i)
#define FOD(i, a, b) for (int i = a; i >= b; --i)
#define FORR(i, a, b, c) for (int i = a; i <= b; i += c)
#define endl "\n"
#define file(name) if (fopen(name".inp", "r")) { freopen(name".inp", "r", stdin); freopen(name".out", "w", stdout); }
using namespace std;
int d[MAXN];
void sieve()
{
FOR(i, 2, MAXN) d[i] = 1;
FOR(i, 2, trunc(sqrt(MAXN)))
FORR(j, i * i, MAXN, i)
{
d[j] += i;
if (i *i != j) d[j] += (j / i);
}
}
__SHI__
{
fastio;
sieve();
int n; cin >> n;
int a[n + 3], cnt = 0;
FOR(i, 1, n)
{
cin >> a[i];
if (d[a[i]] > a[i]) ++cnt;
}
cout << cnt;
return 0;
}