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