#include using namespace std; using ll = long long; #define all(A) A.begin(),A.end() using vll = vector; #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) using Graph = vector>; ll mod=1e9+7; ll sqrtz(ll N) { ll L = 0; ll R = sqrt(N)+10000; while (abs(R - L) > 1) { ll mid = (R +L) / 2; if (mid * mid <= N)L = mid; else R = mid; } return L; } int main() { ll N; cin>>N; vector P(1e6,true); P[0]=P[1]=false; ll an=-(N>=2); for(ll i=2;i<=N;i++){ if(P[i]){ ll j=sqrtz(i+2); if(j*j==i+2&&P[j])an+=2; for(ll m=i*2;m<=1e6-1;m+=i){ P[m]=false; } } } cout<