#include <bits/stdc++.h>
using namespace std;
bool b[100009];
int a, n, ans;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  for (int i = 2; i <= 1000; i++) {
    if (!b[i]) {
      for (int j = i * i; j <= 100000; j += i) b[j] = 1;
    }
  }
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (!b[a]) {
      ans++;
      b[a] = 1;
    }
  }
  cout << ans << endl;
  return 0;
}
