#include <bits/stdc++.h>
using namespace std;
int main(void) {
  bool flag;
  int n, k = 0, a;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    flag = false;
    for (int j = a - 1; 1 < j; j--) {
      if (a % j == 0) {
        flag = true;
        break;
      }
    }
    if (flag == false) k += 1;
  }
  cout << k << endl;
  return 0;
}
