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