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