#include <bits/stdc++.h>
int main() {
  int i, j, N, a, c = 0;
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%d", &a);
    if (a == 2)
      j = 1;
    else if ((a % 2) == 0)
      j = 0;
    else {
      for (j = 3; j < (int)sqrt(a); j += 2)
        if ((a % j) == 0) {
          j = 0;
          break;
        }
    }
    if (j != 0) c++;
  }
  printf("%d\n", c);
  return 0;
}
