#include <bits/stdc++.h>
int main() {
  int n, tmp, count = 0, limit;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &tmp);
    limit = sqrt(tmp);
    switch (tmp) {
      case 2:
      case 3:
        break;
      default:
        if (tmp % 2 == 0) {
          count++;
        } else {
          for (int j = 5; j <= limit; j += 2) {
            if (tmp % j == 0) {
              count++;
              break;
            }
          }
        }
        break;
    }
  }
  printf("%d\n", n - count);
}
