#include <bits/stdc++.h>
using namespace std;
bool isPrime(int n) {
  bool flag = false;
  if (n % 2 == 0) {
    if (n == 2) {
      flag = true;
    }
  } else {
    for (int i = 3; i <= n; i += 2) {
      if (n == i) {
        flag = true;
        break;
      } else if (n % i == 0) {
        flag = false;
        break;
      } else
        flag = true;
    }
  }
  return flag;
}
int main(void) {
  int n = 0;
  int count = 0;
  std::vector<int> vec;
  while (cin >> n) {
    vec.push_back(n);
  }
  sort(vec.begin(), vec.end());
  vec.erase(unique(vec.begin(), vec.end()), vec.end());
  for (int i = 0; i < (int)vec.size(); ++i) {
    if (isPrime(vec[i])) count++;
  }
  cout << count << "\n";
}
