#include <bits/stdc++.h>
int main() {
  int a, cnt = 0, i, j;
  int *num;
  scanf("%d", &a);
  num = (int *)malloc(a * sizeof(int));
  for (i = 0; i < a; i++) {
    scanf("%d", &num[i]);
    for (j = num[i] - 1; 2 <= j; j--) {
      if (j == 2) cnt++;
      if (num[i] % j == 0) break;
    }
  }
  printf("%d\n", cnt);
  free(num);
  return 0;
}
