#include <bits/stdc++.h>
int main(void) {
  int n, i, max, count = 0, flag = 0;
  int *heap;
  while (scanf("%d", &n) != EOF) {
    if (n <= 1) break;
    flag = 0;
    for (i = 2; i < n; i++) {
      if (n % i == 0) flag = 1;
    }
    if (flag == 0) count++;
  }
  return 0;
}
