#include <bits/stdc++.h>
using namespace std;
int a[1000];
int n;
int main() {
  cin >> n;
  int x, cnt = 0;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    int k = 0;
    for (int j = 1; j <= x; ++j)
      if (x % j == 0) k++;
    if (k == 2) cnt++;
  }
  cout << cnt << endl;
  return 0;
}
