#include <bits/stdc++.h>
int main() {
  long int N, a = 0, i, j, sum3 = 0, sum2 = 0, k;
  scanf("%ld", &N);
  long int num[N], p = 0;
  for (i = 0; i < N; i++) {
    scanf("%ld", &num[i]);
  }
  for (k = 0; k < 1; k++) {
    for (i = 0; i < N; i++) {
      if (num[i] > 3) {
        p = num[i] / 2;
        for (j = 2; j <= p; j++) {
          a = num[i] % j;
          if ((a == 0) && (j <= p)) {
            sum2 = sum2 + 1;
            a = 0;
            p = 0;
            break;
          }
        }
      } else
        continue;
    }
    sum3 = (N - sum2);
    printf("%ld\n", sum3);
  }
  return 0;
}
