#include <bits/stdc++.h>
int main() {
  int i, j, num, count, key;
  int pri[10000];
  double sqrtNum;
  scanf("%d", &num);
  if (num < 1 || num > 10000) exit(1);
  count = num;
  for (i = 0; i < num; i++) {
    scanf("%d", &pri[i]);
    if (pri[i] < 2 || pri[i] > 10e8) exit(1);
  }
  for (i = 0; i < num; i++) {
    if (pri[i] < 2)
      key = 1;
    else if (pri[i] == 2)
      key = 0;
    else if (pri[i] % 2 == 0)
      key = 1;
    else {
      sqrtNum = sqrt(pri[i]);
      for (j = 3; j <= sqrtNum; j += 2) {
        if (pri[i] % j == 0) key = 1;
      }
    }
    if (key == 0) count--;
  }
  printf("%d\n", count);
  return 0;
}
