#include <bits/stdc++.h>
int ifprime(int a, int count);
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;
  count = 0;
  for (int i = 0; i < number; i++) {
    count = ifprime(array[i], count);
  }
  printf("%d", count);
  printf("\n");
  return (EXIT_SUCCESS);
}
int ifprime(int a, int count) {
  if (a <= 1) exit;
  if (a == 2) count++;
  if (a > 2) {
    int b = 1;
    for (int i = 2; i < a; i++) {
      if (a % i == 0) {
        b = 0;
      }
    }
    if (b != 0) {
      count++;
    }
  }
  return count;
}
