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