#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
bool isprime[100000000];
void makeprime() {
  for (int i = 0; i < (int)(100000000); i++)
    if (i % 2 != 0) isprime[i] = true;
  isprime[1] = false;
  isprime[2] = true;
  for (long long int i = 3; i < sqrt(100000000); i += 2) {
    for (long long int j = i + 2; j < 100000000; j += 2) {
      if (j % i == 0) isprime[j] = false;
    }
  }
}
int main() {
  makeprime();
  int n;
  cin >> n;
  int cnt = 0;
  for (int i = 0; i < (int)(n); i++) {
    long long int tmp;
    cin >> tmp;
    if (isprime[tmp]) cnt++;
  }
  cout << cnt << endl;
}
