#include <bits/stdc++.h>
int main() {
  int i, hantei = 0, count = 0, n;
  int *sosu, z;
  scanf("%d", &n);
  sosu = (int *)malloc(n * sizeof(int));
  for (i = 0; i < n; i++) {
    scanf("%d", &sosu[i]);
  }
  for (i = 0; i < n; i++) {
    for (z = 1; z <= sosu[i]; z++) {
      if (sosu[i] % z == 0) hantei++;
    }
    if (hantei == 2) count++;
    hantei = 0;
  }
  printf("\n%d\n", count);
  return 0;
}
