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