#include <bits/stdc++.h>
int natural(int);
int main() {
  int N, a[10000];
  int i, count;
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%d", &a[i]);
  }
  for (i = 0; i < N; i++) {
    if (natural(a[i]) == 1) count++;
  }
  printf("%d\n", count);
  return 0;
}
int natural(int a) {
  int j, b;
  int Ans, count;
  Ans = 0;
  b = 0;
  for (j = 1; j <= a; j++) {
    if (a % j == 0) Ans++;
  }
  if (Ans == 2) b = 1;
  return b;
}
