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