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