#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  int a[10000];
  int i, j;
  cin >> n;
  for (i = 0; i < n; i++) cin >> a[i];
  int ans = 0;
  for (i = 0; i < n; i++) {
    j = 2;
    while (a[i] % j != 0) {
      j++;
    }
    if (a[i] == j) ans++;
  }
  cout << ans << endl;
  return 0;
}
