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