#include <bits/stdc++.h>
int main() {
  int n, a[10000], cnt = 0;
  std::cin >> n;
  for (int i = 0; i < n; i++) {
    std::cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    int j = 2;
    while (a[i] % j != 0) {
      j++;
      if (j >= sqrt(a[i])) {
        cnt++;
        break;
      }
    }
    if (a[i] == 2) {
      cnt++;
    }
  }
  std::cout << cnt << '\n';
  return 0;
}
