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