#include <bits/stdc++.h>
using namespace std;
bool is_prime[1000 + 1];
int input[10000];
int n;
void load(void) {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> input[i];
  }
}
int main(void) {
  for (int i = 2; i <= 1000; ++i) {
    is_prime[i] = true;
  }
  for (int i = 2; i <= 32; ++i) {
    if (!is_prime[i]) continue;
    for (int j = 2 * i; j <= 1000; j += i) {
      is_prime[j] = false;
    }
  }
  load();
  int cnt = 0;
  for (int i = 0; i < n; ++i) {
    bool flag_prime = true;
    int x = input[i];
    for (int j = 2; j <= 1000; ++j) {
      if (!is_prime[j]) continue;
      if (x != j && x % j == 0) {
        flag_prime = false;
        break;
      }
    }
    if (flag_prime) ++cnt;
  }
  cout << cnt << endl;
  return 0;
}
