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