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