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