#include <bits/stdc++.h>
using namespace std;
unsigned long gcd(unsigned long a, unsigned long b) {
  while (a && b && a != b)
    if (a > b)
      a = a % b;
    else if (b > a)
      b = b % a;
  return max(a, b);
}
bool prime(unsigned long a) {
  for (unsigned long b = 2; b < a; ++b)
    if (gcd(a, b) != 1) return false;
  return true;
}
int main() {
  int n;
  scanf("%lu", &n);
  unsigned long count = 0;
  unsigned long d;
  for (int i = 0; i < n; ++i) {
    scanf("%lu", &d);
    if (prime(d)) ++count;
  }
  cout << count << endl;
  return 0;
}
