#include <bits/stdc++.h>
using namespace std;
int heheda(int a);
int heheda(int a) {
  int count = 0;
  if (a > 2) {
    for (int i = 2; i < a - 1; i++) {
      if (a % i == 0) {
        count += 1;
        break;
      }
    }
  } else if (a == 2) {
    count += 0;
  }
  return count;
}
int main() {
  int n;
  cin >> n;
  int A[100];
  for (int i = 0; i < n; i++) {
    cin >> A[i];
  }
  int tmp;
  int tmp2 = 0;
  for (int i = 0; i < n; i++) {
    tmp = heheda(A[i]);
    if (tmp != 0) {
      tmp2 += 1;
    }
  }
  cout << n - tmp2;
  return 0;
}
