#include <bits/stdc++.h>
int i, a;
bool sosu(int a) {
  for (i = 2; i < a; i++) {
    if (a % i == 0) return false;
  }
  return true;
}
int main(void) {
  int n, x, count = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &x);
    if (sosu(x) == true) count++;
  }
  printf("%d\n", count);
  return 0;
}
