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