#include <bits/stdc++.h>
using namespace std;
int main() {
  int count = 0, flag, n, num[10000] = {}, a;
  for (int i = 2; i < 10001; i++) {
    flag = 1;
    for (int j = 2; j * j <= i; j++)
      if (num[j] == 1 && i % j == 0) {
        flag = 0;
        break;
      }
    if (flag) num[i]++;
  }
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a < 10001 && num[a])
      count++;
    else if (a > 10000)
      for (int j = 2; j < 10001; j++)
        if (num[j] && !(a % num[j])) count++;
  }
  cout << count << endl;
  return 0;
}
