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