#include<stdio.h>
#include<iostream>
#include<stdlib.h>
const int MAX_L = 101;
int f[MAX_L];
bool used[MAX_L];
int N;
int ans;
int init()
{
scanf("%d",&N);
}
int dfs(int step,int first)
{
if(step>N) {ans++;return 0;}
int i;
for(i=first;i<=N;i++)
if(!used[i])
{
used[i]=true;
if (step<N)
dfs(step+1,i+1);
dfs(step+1,1);
used[i]=false;//dfs
}
}
int put()
{
printf("%d",ans);
}
int main()
{
freopen("bhi.in","r",stdin);
freopen("bhi.out","w",stdout);
init();
dfs(1,1);
put();
return 0;
}
#include<stdio.h>
#include<iostream>
#include<stdlib.h>
const int MAX_L = 101;
int f[MAX_L];
int C[MAX_L][MAX_L];
int N;
int c(int n,int m)
{
if (m==0||m==n) return 1;
if (C[n][m]) return C[n][m];
return C[n][m] = c(n-1,m-1)+c(n-1,m);
}
int init()
{
scanf("%d",&N);
}
int work()
{
int i,j;
f[0]=1;
f[1]=1;
for(i=2;i<=N;i++) //dp
for(j=1;j<=i;j++)
f[i]+=c(i,j)*f[i-j];
}
int put()
{
printf("%d",f[N]);
}
int main()
{
freopen("bhi.in","r",stdin);
freopen("bhi.out","w",stdout);
init();
work();
put();
return 0;
}
#include<stdio.h>
#include<iostream>
#include<memory.h>
const int MAX_L = 101;
int f[MAX_L];
bool used[MAX_L];
int N;
int ans;
int init()
{
scanf("%d",&N);
memset(f,-1,sizeof(f));
}
int dfs(int step,int first)
{
if(step>N) {ans++;return 0;}
int i;
for(i=first;i<=N;i++)
if(!used[i])
{
used[i]=true;
if (step<N)
dfs(step+1,i+1);
if (f[N-step]==-1)
{
f[N-step]=ans;
dfs(step+1,1);
f[N-step]=ans-f[N-step];
}
else ans+=f[N-step];
used[i]=false;
}
}
int put()
{
printf("%d",ans);
}
int main()
{
freopen("bhi.in","r",stdin);
freopen("bhi.out","w",stdout);
init();
dfs(1,1);
put();
return 0;
}