import sys import numpy as np input=lambda:sys.stdin.readline().rstrip() #N,M,K=map(int,input().split()) N=int(input()) if N<=3: print([1,2,2][N-1]) sys.exit() dp=np.zeros((N+1,N,2,2),dtype=int) dp[4,2,1,1]=8 dp[4,1,0,1]=4 dp[4,1,1,0]=4 dp[4,0,0,0]=8 for i in range(4,N): for j in range(i): dp[i+1,j+1,0,1]+=2*dp[i,j,0,0] dp[i+1,j-1,0,0]+=j*dp[i,j,0,0] dp[i+1,j,0,0]+=(i-j-1)*dp[i,j,0,0] dp[i+1,j+1,1,1]+=2*dp[i,j,0,1] dp[i+1,j-1,0,0]+=dp[i,j,0,1] dp[i+1,j-1,1,0]+=(j-1)*dp[i,j,0,1] dp[i+1,j,1,0]+=(i-j-1)*dp[i,j,0,1] dp[i+1,j,0,1]+=dp[i,j,1,0] dp[i+1,j+1,0,1]+=dp[i,j,1,0] dp[i+1,j-1,0,0]+=(j-1)*dp[i,j,1,0] dp[i+1,j,0,0]+=(i-j)*dp[i,j,1,0] dp[i+1,j-1,0,0]+=dp[i,j,1,1] dp[i+1,j,1,1]+=dp[i,j,1,1] dp[i+1,j+1,1,1]+=dp[i,j,1,1] dp[i+1,j-1,1,0]+=(j-2)*dp[i,j,1,1] dp[i+1,j,1,0]+=(i-j)*dp[i,j,1,1] print(dp[N,0,0,0])