#include <bits/stdc++.h>
int main() {
  int x, count = 0;
  int N, m;
  int i;
  scanf("%d", &N);
  for (m = 0; m < N; m++) {
    scanf("%d", &x);
    if (x == 2 || x == 3) {
      count++;
      continue;
    } else if (x % 2 == 0) {
      continue;
    }
    for (i = 2; i * i <= x; i += 1) {
      if (x % i == 0) {
        break;
      }
      count++;
    }
  }
  printf("%d", count);
  return 0;
}
