#include <bits/stdc++.h>
int main(void) {
  int kosu, count, kazu, waru, sosu = 0;
  scanf("%d", &kosu);
  for (count = 0; count < kosu; count++) {
    scanf("%d", &kazu);
    for (waru = 2; waru <= kazu; waru++) {
      if (waru == kazu) {
        sosu++;
      }
      if ((kazu % waru) == 0) {
        break;
      }
    }
  }
  printf("%d\n", sosu);
  return 0;
}
