#include <bits/stdc++.h>
int main() {
  int kosuu, Num, counter = 0, i, j;
  scanf("%d", &kosuu);
  for (i = 1; i <= kosuu; i++) {
    scanf("%d", &Num);
    if (Num >= 3) {
      for (j = 2; j <= (Num / 2) + 1; j++) {
        if ((Num % j) == 0) {
          counter++;
          break;
        }
      }
    }
    if (Num == 1) {
      counter++;
    }
  }
  printf("%d\n", kosuu - counter);
  return 0;
}
