1 /**************************************************************
2 Problem: 1025
3 User: Tunix
4 Language: C++
5 Result: Accepted
6 Time:368 ms
7 Memory:4796 kb
8 ****************************************************************/
9
10 //BZOJ 1025
11 #include<cstdio>
12 #include<algorithm>
13 #define rep(i,n) for(int i=0;i<n;++i)
14 #define F(i,j,n) for(int i=j;i<=n;++i)
15 using namespace std;
16 typedef long long LL;
17 const int N=1010;
18 int n,prime[N],tot,f[N][N];
19 LL ans;
20 bool vis[N];
21 void getprime(int n){
22 F(i,2,n){
23 if (!vis[i]) prime[++tot]=i;
24 F(j,1,tot){
25 if (i*prime[j]>n) break;
26 vis[i*prime[j]]=1;
27 if (i%prime[j]==0) break;
28 }
29 }
30 }
31 int main(){
32 scanf("%d",&n);
33 getprime(n);
34 f[0][0]=1;
35 rep(i,tot) F(j,0,n){
36 F(t,i+1,tot)
37 for(int k=prime[t];j+k<=n;k*=prime[t])
38 f[t][j+k]+=f[i][j];
39 }
40 F(i,1,tot) F(j,1,n) ans+=f[i][j];
41 printf("%lld\n",ans+1);
42 return 0;
43 }