#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x;
  int cnt = 0;
  int flag = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (x == 2)
      flag = 0;
    else if (x % 2 == 0)
      flag = 1;
    else {
      for (int j = 3; j * j < x; j += 2) {
        if (x % j == 0) {
          flag = 1;
          break;
        }
      }
    }
    if (flag == 0) cnt++;
    flag = 0;
  }
  cout << cnt << endl;
  return 0;
}
