#include <bits/stdc++.h>
int main() {
  int n, i, j;
  int count = 0;
  scanf("%d", &n);
  int sosuu[n];
  for (i = 0; i < n; i++) {
    scanf("%d", &sosuu[i]);
  }
  for (i = 0; i < n; i++) {
    for (j = 2; j < n; j++) {
      if (sosuu[i] % j == 0 && sosuu[i] == j) {
        count++;
        break;
      }
    }
  }
  printf("%d\n", count);
  return 0;
}
