#include <bits/stdc++.h>
int main() {
  int y, i, j = 0, l;
  double x;
  int count = 0;
  int m;
  int ha = 0;
  int n[10000];
  scanf("%d", &i);
  while (1) {
    scanf("%d", &n[j]);
    if (i == j + 1)
      break;
    else
      j++;
  }
  for (j = 0; j < i; j++) {
    if (n[j] == 2 || n[j] == 3)
      count++;
    else if (n[j] >= 4) {
      x = sqrt(n[j]);
      for (y = 2; y <= x; y++) {
        l = n[j] % y;
        if (l != 0) {
          count++;
          break;
        }
      }
      if (count != 0) ha++;
    }
  }
  printf("%d\n", ha);
}
