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