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