#include <bits/stdc++.h>
using namespace std;

// #define int long long
#define ll long long
#define pb push_back
#define vi vector<int>
#define vii vector<vector<int> >

template <class X> void print(X Target){ cout << Target << '\n'; }

const int MAX = 100000000;

signed main()
{
  ios::sync_with_stdio(false);
  static bool prime[MAX + 1] = {true, true};

  for (int i = 2; i <= MAX; i++){
    if (!prime[i]){
      for (int j = i * i; j <= MAX; j += i){
        prime[j] = true;
      }
    }
  }

  int n, cnt = 0;
  cin >> n;
  while (n--){
    int num;
    cin >> num;
    if (!prime[num]){
      cnt++;
    }
  }
  print(cnt);

  return (0);
}