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