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