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