#include <bits/stdc++.h>
int main(void) {
  long long n, i, count = 0, check = 0;
  int a[10001] = {
      0,
  };
  while (scanf("%lld", &n) != EOF) {
    if (n > 1 && a[n] == 0) {
      check = 0;
      for (i = 2; i < n; i++) {
        if (n % i == 0) check = 1;
      }
      if (check == 0) {
        count++;
      }
      a[n] = 1;
    }
  }
  printf("%lld\n", count);
  return 0;
}
