#include <bits/stdc++.h>
bool isnotprime[100000005] = {0};
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 2; i <= 10000; i++) {
    if (isnotprime[i]) continue;
    for (int j = 2; j * i <= 100000000; j++) {
      isnotprime[j * i] = 1;
    }
  }
  int count = 0;
  for (int i = 0; i < n; i++) {
    int temp;
    scanf("%d", &temp);
    if (isnotprime[temp] == 0) count++;
  }
  printf("%d\n", count);
  return 0;
}
