#include <stdio.h>
#include <boolean.h>
#include <stdlib.h>
#include <math.h>
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repi(i, n, a) for(int i = a; i < n; ++i)
#define num 100000010

int main(void) {
  int n, i, j, ans = 0, a;
  bool *f;
  f = (bool*)malloc(sizeof(bool) * num);
  rep(i, num) f[i] = true;
  repi(i, sqrt(num), 2) if(f[i]) for(j = 2; i * j <= num) f[i * j] = false;
  scanf("%d", &n);
  rep(i, n) {
    scanf("%d", &a);
    if(f[i]) ++ans;
  }
  printf("%d\n", ans);
  return 0;
}
