#include <bits/stdc++.h>
char checkTable[100000001];
int main() {
  for (int i = 0; i < 100000001; i++) checkTable[i] = 'P';
  for (int i = 2; i <= 10000; i++) {
    if (checkTable[i] == 'P') {
      for (int j = 2 * i; j < 100000001; j += i) {
        checkTable[j] = 'N';
      }
    }
  }
  int n, tmp, count = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &tmp);
    if (checkTable[tmp] == 'P') count++;
  }
  printf("%d\n", count);
}
