#include <bits/stdc++.h>
int sosuu(int);
int main() {
  int a, b, c, count1 = 0;
  scanf("%d", &a);
  for (int i = 0; i < a; i++) {
    scanf("%d", &b);
    c = sosuu(b);
    if (c == 1) count1++;
  }
  printf("%d\n", count1);
  return 0;
}
int sosuu(int x) {
  int count = 0, d;
  for (int i = 1; i <= x; i++) {
    if (x % i == 0) count++;
  }
  if (count == 2)
    d = 1;
  else
    d = 0;
  return d;
}
