#include <bits/stdc++.h>
int main() {
  int A[10000] = {0};
  int length;
  int i = 0, flag = 0;
  int j;
  int count = 0;
  scanf("%d", &length);
  while (i < length) {
    scanf("%d", &A[i]);
    i++;
  }
  for (i = 0; i < length; i++) {
    flag = 0;
    if (A[i] > 2 && A[i] % 2 == 0) {
      continue;
    }
    for (j = 3; j < A[i]; j += 2) {
      if (A[i] % j == 0) {
        flag = 1;
        break;
      }
    }
    if (flag == 0) {
      count++;
    }
  }
  printf("%d\n", count);
  return 0;
}
