#include #include #include #include #include #include #include #include #include #include #include #include #define vll vector #define vvvl vector #define vvl vector> #define VV(a, b, c, d) vector>(a, vector(b, c)) #define VVV(a, b, c, d) vector(a, vvl(b, vll (c, d))); #define re(c, b) for(ll c=0;c> n; if(n==1){ std::cout << 0 << '\n'; return 0; } vector prm(n+1, 1); prm[1] = prm[0] = 0; for(ll i=2;i<=n;i++) for(ll j=i*i;j<=n;j+=i) prm[j] = 0; ll ans = 0; for(ll x=3;x<=n;x++){ if(!prm[x]) continue; ll num = 2 + x; ll t = (ll)round(sqrt(num)); if((t*t)==num&&prm[t]) ans+=2; } std::cout << ans + 1 << '\n'; return 0; }