#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, t, f, ans = 0, s;
  cin >> N;
  int data[10000] = {0};
  for (int i = 0; i < N; i++) {
    cin >> t;
    data[i] = t;
  }
  sort(data, data + N, greater<int>());
  for (int j = 0; j < N; j++) {
    int cnt = 0;
    int m = data[j];
    for (int k = 2; k < m; k++) {
      if (m % k == 0) {
        cnt = 1;
      }
    }
    if (data[j] == 2) {
      cnt = 0;
    } else if (data[j] == 1) {
      cnt = 1;
    }
    if (cnt == 0) ans++;
  }
  cout << ans << endl;
  return 0;
}
