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