#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x;
  cin >> n;
  int count = 0;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (x == 2 || x == 3 || x == 5 || x == 7) {
      count++;
    } else if (x % 2 != 0 && x % 3 != 0 && x % 5 != 0 && x % 7 != 0) {
      count++;
    }
  }
  cout << count << endl;
}
