#include <bits/stdc++.h>
int main(void) {
  int n, i, j, heiho, co = 0, sosu = 0, seisu[10000];
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &seisu[i]);
    heiho = (int)sqrt(seisu[i]);
    co = 0;
    if (seisu[i] % 2 == 0)
      co = 1;
    else {
      for (j = 3; j <= heiho; j += 2) {
        if (seisu[i] % j == 0) co = 1;
      }
    }
    if (co == 0) sosu++;
  }
  printf("%d\n", sosu);
  return 0;
}
