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