#include <bits/stdc++.h>
int ifprime(int a);
int main() {
  int number;
  int readScan = scanf("%d", &number);
  int array[number];
  for (int i = 0; i < number; i++) {
    int readScan = scanf("%d", &array[i]);
    if (readScan != 1) {
      break;
    }
  }
  int count = 0;
  for (int i = 0; i < number; i++) {
    ifprime(array[i]);
    count++;
  }
  printf("%d", count);
  return (EXIT_SUCCESS);
}
int ifprime(int a) {
  for (int i = a / 2; i > 1; i--) {
    if (a % i == 0) return 1;
  }
  return 0;
}
