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