#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[100000000] = {}, m[100000] = {}, n, count = 0;
  a[0] = a[1] = 1;
  for (int i = 2; i * i <= 100000000; i++)
    if (a[i] == 0)
      for (int j = 2; j * i < 100000000; j++) a[i * j] = 1;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> m[i];
    if (a[m[i]] == 0) count++;
  }
  cout << count << endl;
  return 0;
}
