#include <bits/stdc++.h>
bool a[100000000 + 1];
int main() {
  a[1] = true;
  int sum = 0;
  int n;
  int k;
  scanf("%d", &n);
  for (int i = 2; i * i <= 100000000; i++) {
    if (a[i] == false) {
      k = i;
      for (int j = 2; k * j <= 100000000; j++) a[k * j] = true;
    }
  }
  int c;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &c);
    if (!a[c]) sum++;
  }
  printf("%d\n", sum);
  return 0;
}
