#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    bool c = true;
    if (a[i] == 2)
      cnt++;
    else {
      for (int j = 2; j < a[i]; j++)
        if (a[i] % j == 0) c = false;
      if (c == true) cnt++;
    }
  }
  cout << cnt;
  return 0;
}
