#include <bits/stdc++.h>
using namespace std;
int main() {
  static int n;
  cin >> n;
  int in[n];
  static int maxi = -1;
  for (int i = 0; i < n; i++) {
    cin >> in[i];
    if (maxi == -1 || maxi < in[i]) maxi = in[i];
  }
  maxi = maxi + 1;
  bool x[maxi];
  memset(x, true, maxi * sizeof(bool));
  x[0] = false;
  x[1] = false;
  for (int i = 2; i < maxi; i++) {
    if (x[i]) {
      for (int j = 2; i * j <= maxi; j++) {
        x[i * j] = false;
      }
    }
  }
  int count = 0;
  for (int i = 0; i < n; i++) {
    if (x[in[i]]) count++;
  }
  cout << count << endl;
}
