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