#include <bits/stdc++.h>
int main() {
  int n, A[10001], i;
  scanf("%d", &n);
  for (i = 0; i <= n - 1; i++) {
    scanf("%d\n", &A[i]);
  }
  int l, m = 0;
  for (i = 0; i <= n - 1; i++) {
    int k = 0;
    if (A[i] == 1) m = m - 1;
    if (A[i] % 2 == 1) {
      for (l = 2; l < A[i] / 2 + 1; l += 2) {
        if (A[i] % l == 0) {
          k = 1;
          break;
        }
      }
      if (k == 0) m++;
    } else {
      if (A[i] == 2) m++;
    }
  }
  printf("%d\n", m);
}
