#include <bits/stdc++.h>
using namespace std;
int main() {
  bool* isPrime = new bool[500000000];
  isPrime[0] = true;
  isPrime[1] = true;
  for (int i = 2; i < 500000000; i++) {
    if (!isPrime[i]) {
      for (int j = i * 2; j < 500000000; j += i) {
        isPrime[j] = true;
      }
    }
  }
  int n;
  cin >> n;
  int count = 0;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (x < 50000000) {
      if (!isPrime[x]) {
        count++;
      }
    } else {
      for (int i = 0; i < 50000000; i++) {
        if (!isPrime[i]) {
          if (x % i == 0) {
            break;
          }
        }
        if (i == 50000000 - 1) {
          count++;
        }
      }
    }
  }
  cout << count << endl;
  delete[] isPrime;
  return 0;
}
