#include <bits/stdc++.h>
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++) {
    F = 0;
    for (j = 1; j <= data[i]; j++) {
      if (data[i] % j == 0) F++;
    }
    if (F == 2) count++;
  }
  printf("%d\n", count);
  return 0;
}
