#include <bits/stdc++.h>
int main() {
  int i, count = 0, n, flag, j, *sosu;
  scanf("%d", &n);
  sosu = (int *)malloc(n * sizeof(int));
  for (i = n - 1; i >= 0; i--) {
    scanf("%d", &sosu[i]);
    for (j = sosu[i] - 1; j > 1; j--) {
      if (sosu[i] % j == 0) flag++;
      if (sosu[i] % 2 == 0) continue;
    }
    if (flag == 0) count++;
    flag = 0;
  }
  printf("%d\n", count);
  return 0;
}
