#include <bits/stdc++.h>
int main() {
  int num, x, count = 0, i, r;
  int hantei(int);
  scanf("%d", &num);
  for (i = 0; i < num; i++) {
    scanf("%d", &x);
    r = hantei(x);
    if (r == 1) count++;
  }
  printf("%d\n", count);
  return 0;
}
int hantei(int x) {
  int j;
  for (j = 2; j < x; j++) {
    if (x % j == 0) {
      break;
    }
  }
  if (j == x)
    return 1;
  else
    return 0;
}
