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