#include <bits/stdc++.h>
int main(void) {
  int i, j, n, p, count = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &p);
    if (p == 2) {
      count++;
    } else if (p % 2 != 0 && p > 2) {
      for (j = 3; j < sqrt((double)p); j += 2) {
        if (p % j == 0) {
          break;
        }
      }
      if (p % j) {
        count++;
      }
    }
  }
  printf("%d", count);
  return 0;
}
