#include <bits/stdc++.h>
int main(void) {
  int m = 2, n = 100, a[1000000] = {}, num[10005], i = 1, sum;
  a[0] = a[1] = 1;
  while (m * m <= 1000000) {
    for (i = 2; m * i < 1000000; i++) {
      a[m * i] = 1;
    }
    m++;
  }
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", &num[i]);
  for (i = 1; i <= n; i++)
    if (a[num[i]] == 0) sum++;
  printf("%d\n", sum);
  return 0;
}
