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