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