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