#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, i, j, ans = 0;
  long num;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> num;
    for (j = 2; j < num; j++)
      if (num % j == 0 && num != j) {
        num = 0;
        break;
      }
    num != 0 ? ans++ : 1;
  }
  cout << ans << endl;
}
