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