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