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