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