#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, s, p, tmp;
  int primes[1229];
  primes[i = 0] = 2;
  for (p = 3; p < 10000; p += 2) {
    s = sqrt((double)p);
    for (j = 0; j <= i; j++) {
      tmp = primes[j];
      if (tmp > s) {
        i++;
        primes[i] = p;
        break;
      } else if (p % tmp == 0) {
        break;
      }
    }
  }
  int N;
  cin >> N;
  int n, count = 0;
  for (i = 0; i < N; i++) {
    cin >> n;
    s = sqrt((double)n);
    for (int p : primes) {
      if (p > s) {
        count++;
        break;
      } else if (n % p == 0) {
        break;
      }
    }
  }
  cout << count << endl;
  return 0;
}
