#include <bits/stdc++.h>
int main(void) {
  int n, num, i, j, cnt = 0;
  ;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &num);
    if (num != 2) {
      for (j = 2; j < num; j++) {
        if (num % j == 0) {
          cnt++;
          break;
        }
      }
    }
  }
  printf("%d\n", n - cnt);
  return 0;
}
