#include <bits/stdc++.h>
int main(int argc, char* argv[]) {
  int N;
  int leng, j, k;
  int count = 0;
  scanf("%d", &leng);
  for (j = 0; j < leng; j++) {
    scanf("%d", &N);
    for (k = 2; k < N; k++) {
      if ((N % k) == 0) break;
    }
    if (k == N) count++;
  }
  printf("%d\n", count);
  return 0;
}
