#include <bits/stdc++.h>
int judge(long);
int main(void) {
  long work, data[10000];
  int cnt = 0, flag = 0, ans = 0;
  int i;
  while (scanf("%d", &work) != EOF) {
    for (i = 0; i < cnt; i++) {
      if (work == data[i]) flag = 1;
    }
    if (flag == 0) {
      if (judge(work) == 1) ans++;
      data[cnt] = work;
      cnt++;
    }
    flag = 0;
  }
  printf("%d\n", ans);
  return 0;
}
int judge(long work) {
  long i;
  for (i = 2; i < work; i++) {
    if (work % i == 0) return -1;
  }
  return 1;
}
