1 /**************************************************************
2 Problem: 1025
3 User: AsmDef
4 Language: C++
5 Result: Accepted
6 Time:4 ms
7 Memory:824 kb
8 ****************************************************************/
9
10 /***********************************************************************/
11 /**********************By Asm.Def-Wu Jiaxin*****************************/
12 /***********************************************************************/
13 #include <cstdio>
14 #include <cstring>
15 #include <cstdlib>
16 #include <ctime>
17 #include <cctype>
18 #include <algorithm>
19 #include <cmath>
20 using namespace std;
21 typedef long long LL;
22 #define SetFile(x) ( freopen(#x".in", "r", stdin), freopen(#x".out", "w", stdout) )
23 #define getc() getchar()
24 template<class T>inline void getd(T &x){
25 char ch = getc();bool neg = false;
26 while(!isdigit(ch) && ch != ‘-‘)ch = getc();
27 if(ch == ‘-‘)ch = getc(), neg = true;
28 x = ch - ‘0‘;
29 while(isdigit(ch = getc()))x = x * 10 - ‘0‘ + ch;
30 if(neg)x = -x;
31 }
32 inline void putLL(LL x){
33 if(x < 1000000000){printf("%d\n", x);return;}
34 int l = x / 1000000000, r = x % 1000000000;
35 printf("%d%09d\n", l, r);
36 }
37 /***********************************************************************/
38 const int maxn = 1010;
39 int prime[maxn], pcnt, N;
40 LL F[maxn], tmp[maxn];
41 inline void euler(){
42 bool not_p[maxn] = {0};
43 int i, j;
44 for(i = 2;i <= N;++i){
45 if(!not_p[i])prime[++pcnt] = i;
46 for(j = 1;j <= pcnt;++j){
47 if(i * prime[j] > N)break;
48 not_p[i * prime[j]] = true;
49 if(i % prime[j] == 0)break;
50 }
51 }
52 }
53
54 inline void work(){
55 getd(N);
56 euler();
57 //for(int i = 1;i <= pcnt;++i)printf("%d\n", prime[i]);
58 int i, j, p, d;
59 LL ans = 1;
60 F[0] = 1;
61 for(i = 1;i <= pcnt;++i){
62 p = prime[i];
63 memcpy(tmp, F, sizeof(F));
64 for(d = p;d <= N;d *= p)
65 for(j = d;j <= N;++j)F[j] += tmp[j-d];
66 }
67 for(i = 1;i <= N;++i) ans += F[i];
68 putLL(ans);
69 }
70
71 int main(){
72
73 #ifdef DEBUG
74 freopen("test.txt", "r", stdin);
75 #elif !defined ONLINE_JUDGE
76 //SetFile(bzoj_1025);
77 #endif
78 work();
79
80 #ifdef DEBUG
81 //printf("\n%.2lf sec \n", (double)clock() / CLOCKS_PER_SEC);
82 #endif
83 return 0;
84 }