#include <bits/stdc++.h>
int main() {
  int n, i, j, k, count = 0, add = 0;
  scanf("%d", &n);
  int A[i];
  for (i = 0; i < n; i++) {
    scanf("%d", &A[i]);
  }
  for (i = 0; i < n; i++) {
    k = A[i];
    for (j = 1; j < k; j++) {
      if (j == 1)
        continue;
      else if (j == k)
        continue;
      else if (k % j == 0)
        count++;
      else
        continue;
    }
    if (count == 0) add++;
  }
  return 0;
}
