#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, i, j, count = 0, flag;
  int prime[10000];
  cin >> N;
  for (i = 0; i < N; i++) {
    cin >> prime[i];
    if ((prime[i] % 2) == 0) {
      i--;
      N--;
    }
  }
  for (j = 0; j < N; j++) {
    flag = 0;
    for (i = 3; i < prime[j]; i += 2) {
      if ((prime[j] % i) == 0) {
        flag = 1;
        break;
      }
    }
    if (flag == 0) count++;
  }
  cout << count << endl;
  return 0;
}
