#include <bits/stdc++.h>
bool prime[10000 + 1];
int main() {
  for (int i = 0; i <= 10000; i++) {
    prime[i] = true;
  }
  for (int i = 2; i <= 10000; i++) {
    if (prime[i] == false) continue;
    for (int j = 2; j <= 10000; j++) {
      if (i * j > 10000) break;
      prime[i * j] = false;
    }
  }
  int n;
  scanf("%d", &n);
  int count = 0;
  for (int i = 0; i < n; i++) {
    int num;
    scanf("%d", &num);
    if (prime[i]) count++;
  }
  printf("%d\n", count);
}
