#include <bits/stdc++.h>
int primal_search(int);
int main(void) {
  int n, count = 0;
  scanf("%d", &n);
  int num[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &num[i]);
    if (primal_search(num[i])) {
      count++;
    }
  }
  printf("%d\n", count);
  return 0;
}
int primal_search(int n) {
  int root_n = sqrt(n) + 1;
  if (n <= 1) {
    return 0;
  } else if (n % 2 == 0 && n != 2) {
    return 0;
  } else {
    for (int i = 3; i < root_n; i += 2) {
      int r = n % i;
      if (r == 0) {
        return 0;
      }
    }
  }
}
