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