#include <bits/stdc++.h>
using namespace std;
template <typename t1, class t2>
void input(t1 count, t2 array) {
  for (t1 i = 0; i < count; i++) {
    cin >> array[i];
  }
}
template <typename t1, class t2>
void output(t1 count, t2 array) {
  for (t1 i = 0; i < count; i++) {
    cout << array[i];
    if (i != count - 1) cout << " ";
  }
  cout << endl;
}
long long gcd(long long a, long long b) {
  int x = min(a, b), y = max(a, b);
  if (x == 0)
    return y;
  else
    return gcd(x, y % x);
}
set<long long> prime;
bool isPrime(long long x) {
  for (auto e : prime) {
    if (x % e == 0) return false;
    break;
  }
  return true;
}
int main(void) {
  bool flag;
  for (int i = 2; i <= 10000; i++) {
    flag = true;
    for (auto e : prime) {
      if (i % e == 0) flag = false;
      break;
    }
    if (flag) prime.insert(i);
  }
  int n, t, c = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> t;
    if (isPrime(t)) c++;
  }
  cout << c << endl;
}
