#include <bits/stdc++.h>
using namespace std;
bool is_prime[100000001];
int main() {
  memset(is_prime, 1, sizeof(is_prime));
  is_prime[0] = is_prime[1] = false;
  for (int i = 2; i <= 100000000; i++) {
    if (is_prime[i]) {
      for (int j = i * 2; j <= 100000000; j += i) is_prime[j] = false;
    }
  }
  int n;
  scanf("%d", &n);
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    if (is_prime[a]) cnt++;
  }
  printf("%d\n", cnt);
}
