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