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