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