#include <bits/stdc++.h>
bool s[100000002] = {false};
int main() {
  int k = 0, d, n;
  s[0] = true;
  for (int i = 2; i <= 100000002; i++) {
    if (!s[i - 1]) {
      k++;
      for (int j = i; i * j <= 100000002; j += 1) s[i * j - 1] = true;
    }
  }
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &d);
    if (!s[d - 1]) k++;
  }
  printf("%d\n", k);
  return 0;
}
