#include <bits/stdc++.h>
using namespace std;
bool isDivisible(int a, int b) {
  if (a % b == 0)
    return true;
  else
    return false;
}
int main(int argc, char const *argv[]) {
  int n, m, count = 0;
  bool flag;
  cin >> n;
  for (int i = 0; i < n; i++) {
    flag = true;
    cin >> m;
    for (int j = m - 1; j > 1; j--) {
      if (isDivisible(m, j)) {
        flag = false;
        break;
      }
    }
    if (flag) count++;
  }
  cout << count << endl;
  return 0;
}
