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