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