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