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