#include <bits/stdc++.h>
int main(void) {
  int a = 0, n, m, i, j, Rm;
  scanf(" %d", &n);
  for (i = 0; i < n; i++) {
    scanf(" %d", &m);
    Rm = pow(m, 0.5);
    for (j = 2; j < Rm; j++) {
      if (m % j == 0) break;
    }
    if (j == Rm) a++;
  }
  printf("%d\n", a);
}
