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