#include <bits/stdc++.h>
int main() {
  int data[10], flag, i, j, n = 0, sosuu = 0;
  while (1) {
    scanf("%d", &data[n]);
    if (data[n] == -1) break;
    n++;
  }
  for (i = 0; i < n; i++) {
    for (j = 2; j < data[i]; j++) {
      if (data[i] % j == 0) {
        continue;
      } else {
        sosuu++;
      }
    }
  }
  printf("%d\n", sosuu);
}
