#include <bits/stdc++.h>
int main() {
  int i, j, num, prime = 0;
  scanf("%d", &num);
  for (i = 0; i < num; i++) {
    int tmp;
    scanf("%d", &tmp);
    if (tmp == 2) {
      prime++;
    } else if (tmp > 2 && tmp % 2 == 0) {
    } else {
      for (j = 2; j < (int)(sqrt(tmp) + 0.5); j++) {
        if (tmp % j == 0) {
          break;
        }
      }
      if (j == (int)(sqrt(tmp) + 0.5)) {
        prime++;
      }
    }
  }
  printf("%d\n", prime);
  return 0;
}
