#include <bits/stdc++.h>
int main() {
  int ans = 0, n, b, j = 2, maxx;
  std::cin >> n;
  for (int i = 0; i < n; i++) {
    std::cin >> b;
    maxx = (int)sqrt(b) + 1;
    while (true) {
      if (j == maxx) break;
      if (b % j != 0) {
        goto gay;
      }
      j++;
    }
    ans++;
  gay:;
    j = 2;
  }
  std::cout << ans << "\n";
}
