#include <bits/stdc++.h>
int main() {
  int T;
  scanf("%d", &T);
  int m = 0, i, j, s;
  for (i = 1; i <= T; i++) {
    int k = 0;
    scanf("%d", &s);
    for (j = s; j >= 2; j--) {
      if (s % j == 0) {
        k++;
      }
    }
    if (k == 1) {
      m++;
    }
  }
  printf("%d\n", m);
  return 0;
}
