#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N, inp, cnt = 0;
  bool f;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> inp;
    if (inp == 0 || inp == 1)
      f = false;
    else if (inp == 2)
      f = true;
    else if (inp % 2 != 0) {
      for (int j = 3; j <= inp; j++) {
        if (inp == j) {
          f = true;
          break;
        }
        if (inp % j == 0) {
          f = false;
          break;
        }
      }
    } else
      f = false;
    if (f) cnt++;
  }
  cout << cnt << endl;
  return 0;
}
