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