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