#include <bits/stdc++.h>
const static double de_PI = 3.14159265358979323846;
const static int de_MOD = 1000000007;
const static int de_MAX = 999999999;
bool Judge_PrimeNumber(const int a) {
  if (a < 2) {
    return false;
  }
  if (a == 2) {
    return true;
  }
  if (a % 2 == 0) {
    return false;
  }
  for (int i = 3; i < sqrt(a); i += 2) {
    if (a % i == 0) {
      return false;
    }
  }
  return true;
}
int main(void) {
  int N = 0, ans = 0;
  std::cin >> N;
  for (int i = 0; i < N; i++) {
    int temp = 0;
    std::cin >> temp;
    if (Judge_PrimeNumber((temp))) {
      ans++;
    }
  }
  std::cout << ans << std::endl;
}
