#include <bits/stdc++.h>
using namespace std;
int prime(int arr[], int num) {
  int count = 0;
  bool isPrime = true;
  for (int i = 0; i < num; i++) {
    if (arr[i] <= 2)
      count++;
    else if (arr[i] % 2 != 0) {
      for (int j = 3; j < arr[i] && isPrime; j += 2) {
        if (arr[j] % i == 0) isPrime = false;
      }
      if (isPrime) count++;
      isPrime = true;
    }
  }
  return count;
}
int main() {
  int num, *arr;
  cin >> num;
  arr = new int[num];
  for (int i = 0; i < num; i++) {
    cin >> arr[i];
  }
  cout << prime(arr, num) << endl;
  return 0;
}
