#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  long long q[10100];
  long long maximum = 0;
  for (int i = (0); i < (N); ++i) {
    cin >> q[i];
    maximum = max(maximum, q[i]);
  }
  int table[12000];
  for (int i = (0); i < (12000); ++i) {
    table[i] = 1;
  }
  table[0] = 0;
  table[1] = 0;
  for (long long base = 2; base <= 10100; base++) {
    if (!table[base]) continue;
    for (long long p = 2; base * p <= 10100; p++) {
      table[base * p] = 0;
    }
  }
  long long sum = 0;
  for (int i = (0); i < (N); ++i) {
    sum += table[q[i]];
    if (q[i] < 10100) {
    } else {
      for (long long base = 2; base <= 10000; base++) {
        if (q[i] % base == 0) {
          sum++;
          break;
        }
      }
    }
  }
  cout << sum << endl;
  return 0;
}
