#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; }
int isprime[1299710];
void makeprime() {
  for (int i = 0; i < (int)(1299710); i++)
    if (i % 2 != 0) isprime[i] = true;
  isprime[1] = false;
  isprime[2] = true;
  for (long long int i = 3; i < sqrt(1299710); i += 2) {
    for (long long int j = i + 2; j < 1299710; j += 2) {
      if (j % i == 0) isprime[j] = false;
    }
  }
}
int main() {
  int cnt = 0;
  int n;
  cin >> n;
  for (int i = 0; i < (int)(n); i++) {
    long long int tmp;
    cin >> tmp;
    if (tmp == 1) continue;
    if (tmp == 2 || tmp == 3) {
      cnt++;
      continue;
    }
    bool flag = true;
    for (long long int j = 3; j < sqrt(tmp); j += 2) {
      if (tmp % j == 0) flag = false;
    }
    if (flag) cnt++;
  }
  cout << cnt << endl;
}
