#include <bits/stdc++.h>
using namespace std;
int n, ans;
bool judge[100000001];
bool IsPrime(int x) {
  if (judge[x]) return false;
  for (int i = 2; i <= sqrt(x); i++)
    if (x % i == 0) return false;
  int cnt = 0;
  while ((++cnt) * x <= 1e8) judge[cnt * x] = true;
  return true;
}
int main() {
  memset(judge, false, sizeof(judge));
  scanf("%d", &n);
  while (n--) {
    int a;
    scanf("%d", &a);
    if (IsPrime(a)) ans++;
  }
  printf("%d", ans);
  return 0;
}
