#include <bits/stdc++.h>
int main(void) {
  int i, a, n, array[10000], prime = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &array[i]);
  }
  for (i = 0; i < n; i++) {
    if (array[i] == 2) {
      prime++;
      continue;
    } else if (array[i] < 2 || array[i] % 2 == 0)
      continue;
    a = 3;
    while (a <= sqrt(array[i])) {
      if (array[i] % a == 0) {
        prime += 0;
      }
      a = a + 2;
    }
    prime++;
  }
  printf("%d\n", prime);
  return 0;
}
