#include <bits/stdc++.h>
using namespace std;
bool table[10000 + 10];
signed main() {
  int a, n;
  int ans = 0;
  for (int i = 2; i <= sqrt(10000); i++) {
    if (!table[i]) {
      for (int j = 2; j * i <= 10000; j++) {
        table[i * j] = 1;
      }
    }
  }
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (!table[a]) ans++;
  }
  cout << ans << endl;
  return (0);
}
