#include <bits/stdc++.h>
int main(void) {
  int n, i, j, ans = 0, a;
  bool f[100000010];
  for (int i = 0; i < 100000010; ++i) f[i] = true;
  for (int i = 2; i < sqrt(100000010); ++i)
    if (f[i])
      for (j = 2; i * j <= 100000010; ++j) f[i * j] = false;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a);
    if (f[a]) ++ans;
  }
  printf("%d\n", ans);
  return 0;
}
