#include <bits/stdc++.h>
int main(void) {
  int N, n, i, upto, times, cnt = 0;
  scanf("%d", &N);
  while (N--) {
    scanf("%d", &n);
    int prime[n];
    upto = sqrt(n);
    for (i = 0; i < n; i++) {
      prime[i] = 1;
    }
    for (i = 2; i <= upto; i++) {
      if (prime[i] == 1) {
        for (times = 2; i * times <= n; times++) {
          prime[i * times] = 0;
        }
      }
    }
    for (i = 2; i < n; i++) {
      if (prime[i] == 1) {
        cnt++;
        break;
      }
    }
  }
  printf("%d\n", cnt);
  return 0;
}
