#include <bits/stdc++.h>
using namespace std;
bool prime[10001];
int main() {
  prime[0] = prime[1] = 1;
  for (int i = 2; i * i <= 10000; i++)
    for (int j = 2; j <= 10000 / i && prime[i] == 0; j++) prime[j * i] = 1;
  int n, ans = 0;
  cin >> n;
  while (n--) {
    int a;
    cin >> a;
    if (!prime[a]) ans++;
  }
  cout << ans << endl;
}
