#include <bits/stdc++.h>
int main(void) {
  int N;
  int a[10000];
  int i, j;
  int cnt = 0;
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%d", &a[i]);
  }
  for (i = 0; i < N; i++) {
    for (j = 2; j * j <= a[i]; j += 2) {
      if (a[i] != j && a[i] % j == 0) {
        cnt++;
        break;
      }
    }
  }
  printf("%d\n", N - cnt);
  return 0;
}
