#include <bits/stdc++.h>
int main() {
  int count = 0;
  int n, x;
  std::cin >> n;
  for (int i = 0; i < n; i++) {
    std::cin >> x;
    if (x == 1) continue;
    for (int j = 2; j <= x; j++) {
      if (j == x)
        count++;
      else if ((x % j) == 0)
        break;
    }
  }
  std::cout << count << std::endl;
  return 0;
}
