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