#include <bits/stdc++.h>
int main() {
  int m[10000];
  int i, j, cnt = 0, n, a;
  while (1) {
    scanf("%d", &n);
    if (n >= 1 && n <= 10000) {
      break;
    }
  }
  for (i = 0; i < n; i++) {
    scanf("%d", &m[i]);
    if (m[i] < 2 && m[i] > 100000000) {
      break;
    }
  }
  for (i = 0; i < n; i++) {
    a = sqrt(m[i]);
    for (j = a; j > 2; j--) {
      if (m[i] % j == 0) {
        break;
      }
    }
    if (a % j != 0 || a == 2 || a == 3) {
      cnt++;
    }
  }
  printf("%d\n", cnt);
  return 0;
}
