#include <bits/stdc++.h>
int prime(int);
int main() {
  int N, a[10000];
  int i, count;
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%d", &a[i]);
  }
  for (i = 0; i < N; i++) {
    if (prime(a[i]) == 1) count++;
  }
  printf("%d\n", count);
  return 0;
}
int prime(int a) {
  int j, b;
  int Ans, count;
  Ans = 0;
  b = 0;
  if (a == 2) return b = 1;
  for (j = 3; j <= sqrt(a); j += 2) {
    if (a % j == 0) b = 1;
  }
  if (b == 1)
    return b;
  else
    return 0;
}
