#include <bits/stdc++.h>
using namespace std;
int i = 0;
int k;
bool prime(int n) {
  if (n == 1) {
    return false;
  }
  i = (int)sqrt(n) + 1;
  for (k = 2; k < i; k++) {
    if (n % k == 0) return false;
  }
}
int main() {
  int count = 0;
  bool matched[99] = {true};
  int a[99];
  int n, l;
  cin >> n;
  for (l = 0; l < n; l++) {
    scanf("%d", &a[l]);
  }
  for (l = 0; l < n; l++) {
    matched[l] = prime(a[l]);
  }
  for (l = 0; l < n; l++) {
    if (matched[l]) count++;
  }
  cout << count << endl;
  return 0;
}
