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