#include <bits/stdc++.h>
int num[10000000] = {0};
void func(int n) {
  for (int i = 2; i <= n; ++i) {
    bool f = true;
    for (int j = 2; j * j <= i; ++j) {
      if (i % j == 0) f = false;
    }
    if (f)
      num[i] = 1;
    else
      num[i] = 0;
  }
}
int main() {
  int n;
  std::cin >> n;
  int ans = 0;
  func(10000000);
  for (int i = 0; i < n; ++i) {
    int a;
    std::cin >> a;
    if (num[a] == 1) {
      ans++;
    }
  }
  std::cout << ans << std::endl;
  return 0;
}
