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