#include <bits/stdc++.h>
int main() {
  int *a, i, j, n, cnt;
  scanf("%d", &n);
  a = (int *)malloc(sizeof(int) * n);
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  cnt = n;
  for (j = 0; j < n; j++) {
    if (a[j] < 2 || a[j] % 2 == 0) cnt--;
    if (a[j] != 2) {
      for (i = 3; i <= sqrt(a[j]); i = i + 2) {
        if (a[j] % i == 0) {
          cnt--;
          break;
        }
      }
    }
  }
  printf("%d\n", cnt);
  return 0;
}
