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