#include #include #include bool isPrime2(int num) { if(num == 1) return false; int sprt = std::sqrt(num); int del = 2; if (num % del == 0) return false; del++; while (del <= sprt) { if(num % del == 0) return false; del += 2; } return true; } int main() { std::string numStr; std::cin >> numStr; int cnt = 0; while (true) { cnt += isPrime2(atoi(numStr.c_str())); if(numStr.size() == 1) break; numStr = numStr.substr(1); while (numStr[0] == '0') numStr = numStr.substr(1); } std::cout << cnt << std::endl; return 0; }