#include <bits/stdc++.h>
int prime(int x) {
  int i;
  int answer = 0;
  if (x % 2 != 0) {
    for (i = 2; i < x; i++) {
      if (x % i == 0) {
        answer = 1;
        break;
      }
    }
    return (answer == 0) ? 1 : 0;
  } else {
    return 0;
  }
}
int main() {
  int n;
  int i;
  int num[20000];
  int count = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &num[i]);
    if (prime(num[i]) == 1) {
      count += 1;
    }
  }
  printf("%d\n", count);
  return 0;
}
