#include <bits/stdc++.h>
using namespace std;
bool isntprime[10001];
int main() {
  isntprime[0] = isntprime[1] = true;
  for (int i = 2; i <= 10000; i++)
    if (!isntprime[i])
      for (int j = i * i; j <= 10000; j += i) isntprime[j] = true;
  int n, cnt, in;
  cin >> n;
  cnt = 0;
  for (int i = 0; i < n; i++) {
    cin >> in;
    if (!isntprime[in]) cnt++;
  }
  cout << cnt << endl;
  return 0;
}
