#include <bits/stdc++.h>
int main() {
  int val;
  int j, N;
  int count = 0;
  scanf("%d", &val);
  while (val > 1) {
    scanf("%d", &N);
    for (j = 2; j * j <= N; j++) {
      if (N % j == 0) break;
    }
    if (j * j > N) count++;
    val--;
  }
  printf("%d\n", count);
  return 0;
}
