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