#include <bits/stdc++.h>
int main() {
  int n, num, sum = 0, i, j;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &num);
    if (num == 2 || num == 3 || num == 5 || num == 7) {
    } else if (num % 2 == 0 || num % 3 == 0 || num % 5 == 0 || num % 7 == 0) {
      sum++;
    } else {
      for (j = 9; j < num; j += 2) {
        if (num % j == 0) {
          sum++;
          break;
        }
      }
    }
  }
  printf("%d\n", n - sum);
  return 0;
}
