#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  int r;
  while (b > 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
int main() {
  int n, cnt = 0;
  cin >> n;
  for (int i; i < n; i++) {
    bool judge = true;
    int num;
    cin >> num;
    for (int j = 2; j < num; j++) {
      if (num % j == 0) judge = false;
    }
    if (judge) cnt += 1;
  }
  cout << cnt << endl;
}
