#include <bits/stdc++.h>
int main() {
  int a[100000] = {};
  int b[100000] = {};
  int k = 0;
  int n;
  int count = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 1; j <= a[i]; j++)
      if (a[i] % j == 0) count++;
    if (count == 2) {
      b[k] = a[i];
      k++;
    }
    count = 0;
  }
  printf("%d\n", k);
}
