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