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