#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
// hdu 1028 Ignatius and the Princess III
int c1[121],c2[121];
int main(int argc, char **argv) {
// freopen("input.txt","r",stdin);
int i,j,k,n;
while(cin>>n){
//初始工作
for(i=0;i<=n;++i){
c1[i]=1;c2[i]=0;
}
// i代表多项式的个数
for(i=2;i<=n;++i){
for(j=0;j<=n;++j)// 对应于前(i-1)个多项式的x^j项
for(k=0;k+j<=n;k+=i){ // 对应于第i个多项式的x^k项
c2[k+j]+=c1[j]; // 乘法后x^(j+k)的系数放入c2[j+k]中
}
for(j=0;j<=n;++j){
c1[j]=c2[j];c2[j]=0;
}
}
cout<<c1[n]<<endl;
}
return 0;
}
其对应的母函数为: