#include <bits/stdc++.h>
using namespace std;
unsigned char prime[100000000];
int main() {
  int primeTop;
  int n;
  int num, count = 0;
  for (int i = 0; i < 100000000; i++) {
    prime[i] = '2';
  }
  prime[0] = prime[1] = '0';
  for (int i = 0; i < sqrt(100000000); i++) {
    if (prime[i] == '2') {
      primeTop = i;
      for (int j = 1; primeTop * j < 100000000; j++) {
        prime[j * primeTop] = '0';
      }
      prime[primeTop] = '1';
    }
  }
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> num;
    if (prime[num] == '1') count++;
  }
  cout << count << endl;
  return 0;
}
