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