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