#include <bits/stdc++.h>
int s[100000001];
void sieve(int n) {
  int m = sqrt(n);
  s[0] = 1;
  s[1] = 1;
  for (int k = 2; k <= m; k++) {
    if (s[k]) continue;
    for (int i = 2 * k; i <= n; i += k) {
      s[i] = 1;
    }
  }
}
int main(void) {
  int n;
  sieve(100000000);
  scanf("%d", &n);
  int count = 0;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    if (!s[x]) count++;
  }
  printf("%d\n", count);
  return 0;
}
