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