#include <bits/stdc++.h>
int main() {
  int i, j, N, a, c = 0;
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%d", &a);
    if ((a % 2) == 0)
      continue;
    else
      for (j = 3; (double)j < a; j += 2)
        if ((a % j) == 0) {
          j = 0;
          break;
        }
    if (j != 0) c++;
  }
  printf("%d\n", c);
  return 0;
}
