#include using namespace std; #define rep(i,s,n) for(int i = s;ipint; typedef vectorvint; typedef vectorvpint; static const ll maxLL = (ll)1 << 62; const int mod=1000000007; int dy[]={-1,0,1,0}; int dx[]={0,1,0,-1}; //#define int ll int n,m; int dp[3010][40101]; vector P; void make_primes(int n) { vector primes; primes.resize(n + 1, true); primes[0] = primes[1] = false; rep(i, 2, sqrt(n)) if (primes[i]) for (int j = 0; i * (j + 2) < n; j++) primes[i * (j + 2)] = false; rep(i, 2, n + 1) if (primes[i]) P.push_back(i); } signed main(){ cin>>n; make_primes(n+1); rep(i,0,3010)rep(j,0,20101)dp[i][j]=-1; dp[0][0]=0; rep(i,0,P.size())rep(j,0,n+1)if(dp[i][j]>=0){ dp[i+1][j]=max(dp[i+1][j],dp[i][j]); dp[i+1][j+P[i]]=max(dp[i+1][j+P[i]],dp[i][j]+1); } int ans=-1; rep(i,0,P.size()){ ans=max(ans,dp[i][n]); } if(ans)cout<