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