#include <bits/stdc++.h>
int main() {
  int a, b[10000], i, l, s, m = 0;
  scanf("%d", &a);
  for (l = 0; l < a; l++) {
    scanf("%d", &b[l]);
  }
  for (i = 0; i < a; i++) {
    if (b[i] == 2)
      m++;
    else
      for (s = 2; s < b[i]; s++) {
        if (b[i] % s == 0) {
          m++;
          break;
        }
      }
  }
  printf("%d\n", a - m);
  return 0;
}
