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