#include <bits/stdc++.h>
int main() {
  int i, j, s, count1 = 0, l, count2 = 0, n = 0;
  scanf("%d", &l);
  while (n < l) {
    n++;
    scanf("%d", &s);
    if (s == 2) {
      count2++;
    }
    if (s % 2 != 0) {
      for (i = 3; i <= s; i += 2) {
        count1 = 0;
        for (j = 3; j <= sqrt(i); j += 2) {
          if (i % j == 0) {
            count1 = 1;
            break;
          }
        }
      }
      if (count1 == 0) count2++;
    }
  }
  printf("%d\n", count2);
}
