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