#include <bits/stdc++.h>
int a;
unsigned int num[100000];
int counter = 0;
unsigned int j = 2;
int main(void) {
  scanf("%d", &a);
  for (int i = 0; i < a; i++) {
    scanf("%d", &num[i]);
  }
  for (int i = 0; i < a; i++) {
    for (unsigned int j = 2; j * j < num[i]; j++) {
      if (num[i] % j != 0)
        ;
      else
        break;
    }
    if (num[i] - 1 < j * j) {
      counter++;
    }
    j = 2;
  }
  printf("%d\n", counter + 1);
  return 0;
}
