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