#include <bits/stdc++.h>
using namespace std;
bool vis[100000005];
void FAT_sv() {
  vis[0] = vis[1] = 1;
  for (long long i = 4; i <= 100000005 - 2; i += 2) vis[i] = 1;
  for (long long i = 3; i * i <= 100000005 - 2; i += 2) {
    if (!vis[i]) {
      for (long long j = (i * i); j <= 100000005 - 2; j += (i + i)) vis[j] = 1;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  FAT_sv();
  long long n;
  cin >> n;
  long long a1[n + 5];
  long long c1 = 0;
  for (long long i = 0; i < n; i += 1) {
    cin >> a1[i];
    if (vis[a1[i]] == 0) c1 += 1;
  }
  cout << c1 << endl;
  return 0;
}
