#include <bits/stdc++.h>
int main(int argc, char** argv) {
  int size;
  scanf("%d\n", &size);
  int array[size];
  for (int i = 0; i < size; i++) scanf("%d", &array[i]);
  int count = 0;
  int primeCount = 0;
  for (int i = 0; i < size; i++) {
    for (int k = 1; k <= array[i] / k; k++) {
      if (array[i] == 1)
        break;
      else if (array[i] % k == 0)
        count++;
    }
    if (count == 1) primeCount++;
    count = 0;
  }
  printf("%d", primeCount);
  return (EXIT_SUCCESS);
}
