#include <bits/stdc++.h>
int main() {
  int n, i, j, array[10000], count = 0, count1 = 0;
  scanf("%d\n", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &array[i]);
  }
  for (i = 0; i < n; i++) {
    for (j = 2; j <= array[i]; j++) {
      if (array[i] % j == 0) count1++;
    }
    if (count1 == 1) count++;
    count1 = 0;
  }
  printf("%d\n", count);
  return 0;
}
