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