#include <bits/stdc++.h>
int main(void) {
  int n;
  int x = 0;
  scanf("%d", &n);
  int a, b;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a);
    b = a;
    if (a == 2) {
      x++;
    }
    for (int t = 2; t <= a; t++) {
      if (b % t == 0) {
        break;
      }
      a = a / t;
      if (t >= a) {
        x++;
        break;
      }
    }
  }
  printf("%d\n", x);
  return 0;
}
