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