#include <bits/stdc++.h>
int countPrime(int array[], int length) {
  int nop = 0;
  int isComposite;
  for (int i = 0; i < length; i++) {
    isComposite = 0;
    for (int j = 2; j < array[i]; j++) {
      if (array[i] % j == 0) {
        isComposite = 1;
        break;
      }
    }
    if (!isComposite) nop++;
  }
  return nop;
}
int main(int argc, char** argv) {
  int length;
  scanf("%d", &length);
  const int nxArray = length;
  int array[nxArray];
  for (int ixArray = 0; ixArray < nxArray; ixArray++)
    scanf("%d", &array[ixArray]);
  printf("%d\n", countPrime(array, nxArray));
  return (EXIT_SUCCESS);
}
