#include <bits/stdc++.h>
int main(void) {
  int count = 0;
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    int num;
    scanf("%d", &num);
    int k = 2;
    while (1) {
      if (k == num) {
        ++count;
        break;
      } else {
        if (num % k == 0) {
          break;
        }
        ++k;
      }
    }
  }
  printf("%d\n", count);
  return 0;
}
