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