#include <bits/stdc++.h>
int main() {
  int isprime[10003], ans = 0, num, b;
  for (int i = 1; i <= 10002; i++) {
    isprime[i] = -1;
  }
  std::cin >> num;
  for (int i = 0; i < num; i++) {
    std::cin >> b;
    if (isprime[b] == -1) {
      for (int i = 2; i <= (int)sqrt(b); i++) {
        if (b % i != 0) {
          isprime[b] = 0;
          goto nope;
        }
      }
      ans++;
      isprime[b] = 1;
    } else if (isprime[b] == 1)
      ans++;
  nope:;
  }
  std::cout << ans << "\n";
}
