#include using namespace std; //#include //using namespace atcoder; using ll=long long; using Graph=vector>; #define MAX 1000 #define INF 1000000000000000000 #define MOD 998244353 vector p; vector p_table(MAX+1,true); void prime(){ p_table.at(0)=false,p_table.at(1)=false; for(int i=2;i<=MAX;i++){ if(p_table.at(i)){ p.push_back(i); for(int j=2;i*j<=MAX;j++){ p_table.at(i*j)=false; } } } } int main(){ int N; cin>>N; prime(); int n=p.size(); vector> cnt(N+1,vector(n,0)); vector other_p(N+1,0); for(int i=1;i<=N;i++){ int x=i; for(int j=0;j1){ other_p[i]=x; } } vector max_cnt(n,0); vector other_primes(N+1,0); for(int i=1;i<=N-1;i++){ int x=i; int y=N-i; for(int j=0;j0){ other_primes[other_p[y]]=max(other_primes[other_p[y]],1); }else if(other_p[x]>0&&other_p[y]==0){ other_primes[other_p[x]]=max(other_primes[other_p[x]],1); }else if(other_p[x]>0&&other_p[y]>0&&other_p[x]!=other_p[y]){ other_primes[other_p[y]]=max(other_primes[other_p[y]],1); other_primes[other_p[x]]=max(other_primes[other_p[x]],1); }else if(other_p[x]>0&&other_p[y]>0){ other_primes[other_p[x]]=2; } } ll ans=1; for(int i=0;i