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