#include <bits/stdc++.h>
int main() {
  int t;
  while (scanf("%d", &t) != EOF) {
    int a[t];
    int i, j;
    int count = 0;
    int test_number;
    int remainder;
    int test;
    for (i = 0; i < t; i++) {
      scanf("%d", &a[i]);
    }
    for (i = 0; i < t; i++) {
      test_number = sqrt(a[i]);
      test = 1;
      for (j = 2; j <= test_number; j++) {
        test = test_number % j;
        if (test == 0) {
          break;
        }
      }
      if (test == 0)
        continue;
      else
        count++;
    }
    printf("%d\n", count);
  }
}
