#include <bits/stdc++.h>
using namespace std;
int dp[10001];
int isPrime(int x) {
  if (dp[x] != -1) return dp[x];
  if (x <= 1) {
    return dp[x] = 0;
  }
  for (int i = 2; i < x - 1; i++) {
    if (x % i == 0) return dp[x] = 0;
  }
  return dp[x] = true;
}
int main() {
  memset(dp, -1, sizeof(dp));
  int n;
  cin >> n;
  int a, cnt = 0;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (isPrime(a)) {
      cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}
