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