#include <bits/stdc++.h>
int main(void) {
  int n, number;
  int cnt = 0;
  int i, j;
  int tr = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &number);
    if (number < 2 || number % 2 == 0) {
      tr = 1;
    } else {
      for (j = 3; j < sqrt(number); j += 2) {
        if (number % j == 0) {
          tr = 1;
          break;
        }
      }
    }
    if (tr == 0) {
      cnt++;
    }
    tr = 0;
  }
  printf("%d\n", cnt);
  return 0;
}
