#include <bits/stdc++.h>
int main(void) {
  int a[10000], i, j, b, k, n, c;
  c = 0;
  scanf("%d\n", &n);
  for (i = 0; i < n; i++) {
    scanf("%d\n", &a[i]);
    b = a[i];
    if (b % 2 == 0)
      c++;
    else {
      for (j = 3; j < b; j += 2) {
        k = 0;
        for (k = 3; k <= sqrt(j); k += 2) {
          if (j % k == 0) {
            k = 1;
            break;
          }
        }
        if (k == 0) c++;
      }
    }
  }
  printf("%d\n", c - 1);
  return 0;
}
