#include <bits/stdc++.h>
using namespace std;
bool ifprime(int n) {
  int a = 2;
  while (a * a <= n) {
    if (n % a == 0) {
      return false;
    }
    a++;
  }
  return true;
}
int main() {
  short N, cnt = 0;
  cin >> N;
  while (N-- > 0) {
    short a;
    cin >> a;
    if (ifprime(a)) {
      cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}
