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