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