#include <bits/stdc++.h>
std::vector<int> Input() {
  int Count;
  std::cin >> Count;
  std::vector<int> List(Count);
  for (int i = 0; i < Count; ++i) {
    std::cin >> List[i];
  }
  return List;
}
struct TIsDivisibility {
  const int FValue;
  TIsDivisibility(const int& Value) : FValue(Value) {}
  bool operator()(int Prime) { return FValue % Prime == 0; }
};
bool IsPrime(int Value, const std::vector<int>& Prime) {
  int Max = std::sqrt(Value);
  for (std::vector<int>::const_iterator It = Prime.begin();
       It != Prime.end() && *It <= Max; ++It) {
    if (Value % (*It) == 0) return false;
  }
  return true;
}
std::vector<int> GetPrimeNumber(int Max) {
  std::vector<int> Prime;
  Prime.reserve(Max);
  Prime.push_back(2);
  for (int i = 3; i <= Max; i += 2) {
    if (IsPrime(i, Prime)) {
      Prime.push_back(i);
    }
  }
  return Prime;
}
struct TIsPrime {
  const std::vector<int>& FPrime;
  TIsPrime(const std::vector<int>& Prime) : FPrime(Prime) {}
  bool operator()(const int& Value) {
    return std::binary_search(FPrime.begin(), FPrime.end(), Value);
  }
};
void Output(const std::vector<int>& List) {
  for (std::vector<int>::const_iterator It = List.begin(); It != List.end();
       ++It) {
    std::cout << *It << std::endl;
  }
}
int main() {
  std::vector<int> Values = Input();
  int Max = *std::max_element(Values.begin(), Values.end());
  std::vector<int> Prime = GetPrimeNumber(Max);
  int Count = std::count_if(Values.begin(), Values.end(), TIsPrime(Prime));
  std::cout << Count << std::endl;
  return 0;
}
