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