#include <bits/stdc++.h>
int Prime(int);
int main() {
  int n, i, c, count1 = 0;
  int A[10000];
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &A[i]);
  }
  for (i = 0; i < n; i++) {
    c = Prime(A[i]);
    if (c == 1) count1++;
  }
  printf("%d\n", count1);
  return 0;
}
int Prime(int x) {
  int i, count;
  if (x == 2)
    return 1;
  else {
    count = 0;
    for (i = 1; i <= x; i++) {
      if (x % i == 0) count++;
    }
    if (count == 2) return 1;
  }
  return 0;
}
