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