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