#include <bits/stdc++.h>
using namespace std;
bool prime[10000005];
int a[10001] = {0};
int N;
int main() {
  for (int i = (0); i < (10000005); i++) {
    prime[i] = true;
  }
  prime[0] = false;
  prime[1] = false;
  for (int i = 2; i * i <= 10000005; i++) {
    if (prime[i]) {
      for (int j = 2; i * j <= 10000005; j++) prime[i * j] = false;
    }
  }
  cin >> N;
  int ans = 0;
  for (int i = (0); i < (N); i++) {
    cin >> a[i];
  }
  sort(a, a + N);
  for (int i = (0); i < (N); i++) {
    if (prime[a[i]] == true) ans++;
  }
  cout << ans << endl;
  return 0;
}
