#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int x;
  int count = 0;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> x;
    for (int j = 2; j < x / 2; j++) {
      if (x % j == 0) count++;
      break;
    }
  }
  cout << count << endl;
  return 0;
}
