#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100000;
const int INF = 0x3f3f3f3f;
bool vis[100000000];
int main() {
  ios::sync_with_stdio(false);
  memset(vis, 0, sizeof(vis));
  int m = sqrt(100000000);
  for (int i = 2; i < m; i++) {
    if (!vis[i])
      for (int j = i * 2; j < 100000000; j = j + i) vis[j] = 1;
  }
  int n, a;
  cin >> n;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (!vis[a]) ans++;
  }
  cout << ans << endl;
  return 0;
}
