#include <bits/stdc++.h>
using namespace std;
bool memo[100000000] = {};
int main() {
  memo[1] = 1;
  for (int i = 2; i < 100000000 / 2; i++) {
    if (memo[i] == 0) {
      for (int k = 2 * i; k < 100000000; k += i) {
        memo[k] = 1;
      }
    }
  }
  int ans = 0;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    if (memo[a]) {
    } else
      ans++;
  }
  cout << ans << endl;
}
