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