#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, cnt = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    long num;
    bool flag = true;
    cin >> num;
    for (int j = 2; j <= num / 2 && flag == true; j++)
      if (num % j == 0) flag = false;
    if (flag == true || num == 2) cnt++;
  }
  cout << cnt << endl;
  return 0;
}
